SignalR - Joins from multiple partial views?

I have a page with two partial views. Each of them uses a (different) hub. So one uses hub1, ​​the other uses hub2. This works fine while I am doing $.connection.hub.start() in both partial views. However, this leads to two open connections to the server.

If I do not make the start() call in one of the partial views, I get synchronization problems and exceptions that I must first call start() .

Is there any way to achieve this? Is $.connection singleton and does it have an event that I can connect to when hubs start?

+4
source share
1 answer

No, he has no event. You can always call the start on the layout page.

0
source

Source: https://habr.com/ru/post/1415452/


All Articles