SignalR How is a duplicate Connection Id handled?

后端 未结 3 1563
执念已碎
执念已碎 2021-01-19 05:46

I have created my own IConnectionIdGenerator implementation which for simpicty in my webforms application names the client connection Id by the EmailAddress.ToL

3条回答
  •  野的像风
    2021-01-19 06:15

    I recently tried to do the same and experienced the same problems, so my conclusion is that the connection id must be unique, otherwise everything starts to fail with repeated 301 and 200 responses.

    What I did to workaround this problem was to use the default GUID connection id and instead add the connection to a group which is identified by my own id (email address in your case) after starting the connection. This way I can call Clients[emailAddress].doSomething() and it broadcasts to all open tabs of this user.

提交回复
热议问题