6

It seems that a SignalR server can throw away messages before they are sent to the client if its internal buffer overflows (see https://github.com/SignalR/SignalR/issues/2075). Currently we add a sequence number to all messages to let the client detect missing messages, but we would rather detect a message loss on the server and handle it there. Is that possible?

xsov
  • 93
  • 1
  • 4
  • possible duplicate of [Can SignalR handle missed messages?](http://stackoverflow.com/questions/10282099/can-signalr-handle-missed-messages) – Mahmoud Darwish Apr 03 '14 at 08:39
  • I don't think it is a duplicate. I am asking whether it is possible to detect on the server when SignalR throws away a message. – xsov Apr 03 '14 at 10:33
  • The reason i see it as a duplicate is that in the response to the issue it self, it was explain that the reason is overflowing the buffer, meaning the messages aren't received by the server, now in the question i linked a good solution is presented which is "Your clients would need to keep track of the most recent ID received. After a network reconnect, the client could ask for all messages since [Last ID]" – Mahmoud Darwish Apr 03 '14 at 10:38
  • Yes, I know what the linked solution said about adding a sequence number to the messages, which we already do, but that is what we want to avoid by detecting the message loss on the server, which is why I asked that question. By the way, in our setup, the problem has nothing to do with the client reconnecting or messages being received by the server. It has to do with the server sending messages faster than they can be delivered to the clients. – xsov Apr 03 '14 at 11:41
  • well, i think SignalR developers are the best to answer this, however i don't think that what you want is implemented, i suggest one of two paths, 1) queue the messages and send them as bulk, 2) extend SignalR to support what you need. – Mahmoud Darwish Apr 03 '14 at 11:51

1 Answers1

0

The way SignalR handles messages is inherently asynchronous and stateless. There is no built-in mechanism for the server to detect that a message wasn't received. If you send a letter, you don't know if it got lost on the way unless you ask the recipient.

As @MEYWD pointed out in a comment, you can add this functionality if you want. If the client knows the latest sequence number it has, it can ask the server if there are any messages it hasn't received. Extending SignalR to detect this sort of thing wouldn't be difficult.

Grace
  • 641
  • 1
  • 7
  • 16