Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

How does signalR maps ConnectionId to connection for specyfic client? #2460

Closed
remotenode opened this issue Jun 8, 2018 · 6 comments
Closed

Comments

@remotenode
Copy link

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?

@BrennanConroy
Copy link
Member

If you are using Redis for scaleout yes

@remotenode
Copy link
Author

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

@BrennanConroy
Copy link
Member

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.

@BrennanConroy
Copy link
Member

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.

@remotenode
Copy link
Author

Thank you for quick answers!

@mikaelm12
Copy link
Contributor

mikaelm12 commented Jun 8, 2018

The main idea here is that even if there are clients connection to different servers that don't know anything about each other directly, they communicate with a backplane (Redis for example). The backplane is the unifying element here
signalr-backplane
(Graphic taken from the docs)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants