Last post Jul 29, 2019 12:47 PM by Yossu
Jul 28, 2019 03:57 PM|Yossu|LINK
I'm using ASP.NET Core MVC, and would like to split one of my pages down into several partial views.
At the moment, I create a SignalR connection, and have one callback function that updates various part of the page. When I split the page, some of the elements that need updating will be in one partial view, and others will be in a separate partial view.
Is there any problem in each partial view creating its own connection and calling its own function? That way I can keep each one independent.
Thanks for any advice you can give.
Jul 29, 2019 05:23 AM|Brando ZWZ|LINK
Short answer: No problem with multiple connections to the same hub method.
According to the SignalR
multiple hubs article:
You can define multiple Hub classes in an application. When you do that, the connection is shared but groups are separate
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.
There is no performance difference for multiple Hubs compared to defining all Hub functionality in a single class.
There no performance difference if you create mutiple hubs and single hubs with multiple functions.
Jul 29, 2019 12:47 PM|Yossu|LINK
Thanks, didn't think there was, but wanted to be sure.