重新连接后的 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 (将#修改为@)