有多个SignalR连接实际上是否创建了连接: [英] Does having multiple SignalR connections actually create connections:

查看:64
本文介绍了有多个SignalR连接实际上是否创建了连接:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有几个使用SignalR的自定义Web表单控件(用于格式检查,用户名可用性,但主要用于通知)。到目前为止,我已经采取了为每个控件创建唯一名称连接的快捷方式。



这实际上是否创建了与服务器的多个连接,或者他们都只使用一个连接。



我希望用户量很大,因此减少每个用户的连接数量至关重要。 />


如果是这样,那么我将花时间重新拟合js文件以使用连接的单个命名实例。如果没有那么我就不会花费任何额外的时间。



提前谢谢^ _ ^

Andy

Hi,

I have several custom web form controls that use SignalR (for format checks, username availability but mostly for the notifications). Up until now, I have taken the shortcut of just creating a unique name connection for each control.

Does this actually create several connections to the server, or do they all just use a single connection.

I expect a high volume of users so cutting down the number of connections per user is critical.

If so then I will spend time retro-fitting the js files to use a single named instance of the connection. If not then I won't spend any extra time.

Thanks in advance ^_^
Andy

推荐答案

先阅读: http ://www.asp.net/signalr/overview/guide-to-the-api/handling-connection-lifetime-events [ ^ ]

---

是的,但使用SignalR 2.0,您可以在单个连接上处理多个集线器: http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-server#multiplehubs [ ^ ]

但是在您尝试完成的活动列表中这样的集线器有一些不属于,并且应该以正常(HTTP)方式完成...例如,应该使用一些基于HTTP(AJAX?)的通信从客户端启动验证(格式检查和用户名可用性)。 .save SignalR到服务器发起的通信,如通知......
Read first: http://www.asp.net/signalr/overview/guide-to-the-api/handling-connection-lifetime-events[^]
---
Yes, but with SignalR 2.0 you can handle multiply hubs on a single connection: http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-server#multiplehubs[^]
However in your list of activities you try to do over such hubs there are some that does not belong and should be done in normal (HTTP) way...For instance, validation (format check and username availability) should be initiated from the client using some HTTP (AJAX?) based communication...save SignalR to server initiated communication, like notifications...


这篇关于有多个SignalR连接实际上是否创建了连接:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆