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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.