How does signalR maps ConnectionId to connection for specyfic client? #2460
Comments
If you are using Redis for scaleout yes |
But how? If second server knows nothing about the client, how will it work? I think I do not have clear understanding how SignalR is mapping ConnectionId to HttpConnection |
Because the two servers are talking to each other over Redis. So if you send a message to a specific connection id the server you're sending to first checks if it knows that connection id, if it doesn't it will send the message over Redis to the other server(s) and the server with that connection id will then send it to the correct client. |
https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr This is a link to the ASP.NET SignalR scaleout docs, be aware that this isn't the same as ASP.NET Core SignalR so some things wont apply, but the general idea and pictures should give you a good idea of how scaleout works. |
Thank you for quick answers! |
One more question:
Let's assume that there are two servers with signalR, I will connect to first server, will second server be able to invoke methods on client if it knows ConnectionId?
The text was updated successfully, but these errors were encountered: