It is impossible to use SignalR, when several tabs opened with unique ids assigned to each tab (see. When SignalR made 8-10 connections at a time live chat doesn't work).
But. there is a workaround I described in this stackoverflow issue. The idea is to overwrite connectionid in order, that every opened tab would have the same connection id: thus, logicaly, in my particular case, there is no reason to have unique ids for each tab, 'cos each tab is opened by one MyApplicationUserId.
Anyway, it has been noticed in stackoverflow (see SignalR How is a duplicate Connection Id handled? ), that connectionid must be unique. And they say, that IConnectionIdGenerator will be removed in an upcomming release.
So, this is a kind of blind alley. I must use unique ids, but I cannot use SignalR with several browser tabs opened.
Thank you. Dmitry.
As has been discussed in the SignalR issue you've opened here, most modern browsers limit the maximum number of concurrent connections (typically around 6) to the same site.
One workaround is to use subdomains, i.e. each tab connects to a different subdomain (this is the approach Facebook is using). Another option would be to start just one connection and use localStorage
as a message bus between tabs as suggested by FreshCode in this question: SignalR and Browser Connection limit
To bypass browser limtation you can use ‛localStorage‛ to communicate between windows and to have only one window as connection owner. Other windows in this case use connection owner to receive/send messages. IWC-SignalR is an implementation of such approach.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With