coder231
coder231

Reputation: 463

Signalr - What happens when I try to send message to disconnected user

What happens when I try to send message to disconnected user in signalr from the server? Does it fire any error or cause some kind of performance issue when many such messages are sent?

Upvotes: 0

Views: 933

Answers (1)

Michael Puckett II
Michael Puckett II

Reputation: 6749

If the user is disconnected you should handle that. SignalR will fall back to legacy timing and polling of the user but eventually just consider that user as a loss and you will lose connection. Once the user reconnects, if you haven't managed your own storage of the lost user then they will no longer receive that message; it will be tossed from the queue... But you will not receive an error. SignalR has events that you can listen to for disconnected users as well as querying their connection before sending messages.. If that user is considered connected and they are reconnected (as the same user) then yes the message will then be delivered. Either way, no errors occur.

Upvotes: 2

Related Questions