在您的网站多signalR连接/集线器 [英] Multiple signalR connections/hubs on your website

查看:135
本文介绍了在您的网站多signalR连接/集线器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有可能会使用多个集线器类的多个页面,什么是管理最好的方法?

If I have multiple pages that could use multiple hub classes, what is the best way to manage this?

-is它坏导航到另一个页面的网站,基本上是重开到同一集线器类是previous页?

-Is it bad to navigate to another page in the website and essentially "reopen" the connection to the same hub class that was open on the previous page?

在页面上 - 多中心的连接是确定的,因为它们都在一个统一的连接,即使它们是不同的轮毂类?

-Multiple hub connections on a page is ok because they are all unified in one connection, even if they are different hub classes?

推荐答案

您可以有多个集线器共享网站上的一个连接。 SignalR 2.0被更新了,在性能上没有少了一个signlar连接来处理多个集线器。

You can have multiple hubs sharing one connection on your site. SignalR 2.0 was updated to handle multiple hubs over one signlar connection with no lost in performance.

官方文档:<一href=\"http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-server#multiplehubs\">http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-server#multiplehubs

所有客户端都将使用相同​​的URL建立与您的服务(/ signalr,或者如果你指定了一个自定义URL)一个SignalR连接,该连接用于通过服务定义的所有集线器。

All clients will use the same URL to establish a SignalR connection with your service ("/signalr" or your custom URL if you specified one), and that connection is used for all Hubs defined by the service.

多个集线器性能差异比较,在一个类中定义的所有集线器功能

这篇关于在您的网站多signalR连接/集线器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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