Dmitry
Dmitry

Reputation: 654

SignalR, Limited unique connections (opened tabs) IIS8, Windows8

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.

Upvotes: 10

Views: 5510

Answers (3)

Kiran Gandhi
Kiran Gandhi

Reputation: 16

yes. You will create dynamic sub-domains for the signal R connections, because there are browser limitation for the concurrent requests [max = 8] and for different browser this concurrent limitation may vary.

For the dynamic sub-domains you need to set DNS for the sub-domains from the hosting panel, so these dynamic sub-domains point to your main domain. e.g. xyz.com is your main domain, abc1.xyz.com is your sub-domain, abc2.xyz.com is your sub-domain, abc3.xyz.com is your sub-domain, abc4.xyz.com is your sub-domain. These all sub-domains point to main domain after DNS setting and IIS setting. This same way works in Chat application. Good luck...

Upvotes: 0

Eugene Khudoy
Eugene Khudoy

Reputation: 211

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.

Upvotes: 1

Alexander Köplinger
Alexander Köplinger

Reputation: 2517

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

Upvotes: 12

Related Questions