Can a SignalR message loss be detected server side?

一曲冷凌霜 提交于 2019-12-23 09:32:38

问题


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.



来源:https://stackoverflow.com/questions/22830823/can-a-signalr-message-loss-be-detected-server-side

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!