微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

重新连接后的 SignalR 集线器未从服务器获取消息

如何解决重新连接后的 SignalR 集线器未从服务器获取消息

我在服务器端使用 signalR 开发了一个应用程序,它将信息发送到客户端站点上的集线器。

客户端的 Hub 声明:

var connection = new signalR.HubConnectionBuilder()
.withUrl("/simpleclienthub")
.configureLogging(signalR.LogLevel.information)
.withAutomaticReconnect()
.build(); 

我已对一些消息实施了操作。集线器工作正常,但几个小时后我在客户端出现错误。集线器重新连接,但重新连接后没有从后端获取消息。从浏览器应用日志:

Utils.ts:182 [2021-06-14T09:00:21.918Z] Error: Connection disconnected with error 'Error: WebSocket closed with status code: 1006 ().'.
ConsoleLogger.log @ Utils.ts:182
Utils.ts:188 [2021-06-14T09:00:21.919Z] information: Connection reconnecting because of error 'Error: WebSocket closed with status code: 1006 ().'.
Utils.ts:188 [2021-06-14T09:00:21.919Z] information: Reconnect attempt number 1 will start in 0 ms.
Utils.ts:188 [2021-06-14T09:00:26.545Z] information: WebSocket connected to ws://10.5.61.10:7070/simpleclienthub?id=JDmDJnKDfCFZxfrg7v1l8Q.
Utils.ts:188 [2021-06-14T09:00:26.545Z] information: Using HubProtocol 'json'.
Utils.ts:188 [2021-06-14T09:00:26.911Z] information: HubConnection reconnected successfully.

你们知道为什么重新连接成功后集线器不起作用吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。