Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to determine if the client received the message using SignalR

Tags:

signalr

If I send a messag using SignalR, is it possible that the client does not receive the message? How can you verify if any errors apeared in the communication? Iam thinking of sending a message back to server after the server notification was sent, but is there any better way?

like image 521
Ryan Avatar asked Oct 07 '22 05:10

Ryan


1 Answers

Yes, it's possible that the client doesn't receive the message. SignalR keeps messages in memory for 30 seconds (by default, you can tweak that or use a persistent message bus), so if the client isn't connected for whatever reason and this timeout passes the client will miss the message. Note that if he reconnects within this period he receives all messages he hasn't got yet, including those that were sent when he was disconnected.

I don't know if SignalR provides a way of telling you when a broadcast failed, so it might be safer to just send an acknowledgement back to the server.

like image 157
Alexander Köplinger Avatar answered Oct 11 '22 01:10

Alexander Köplinger