【发布时间】:2020-06-03 09:52:50
【问题描述】:
在我们的项目中,我将 SignalR 设置如下:
services.AddSignalR()
.AddHubOptions<NotificationHub>(options =>
{
const int keepAliveIntervalInSeconds=60;
options.EnableDetailedErrors=true;
options.ClientTimeoutInterval = TimeSpan.FromSeconds(2 * keepAliveIntervalInSeconds);
options.HandshakeTimeout = TimeSpan.FromSeconds(keepAliveIntervalInSeconds);
options.KeepAliveInterval = TimeSpan.FromSeconds(keepAliveIntervalInSeconds);
});
但它没有按预期工作。我在客户端收到一条错误消息:
[2020-06-03T09:48:44.367Z] Error: Connection disconnected with error 'Error: Server timeout elapsed without receiving a message from the server.'.
我在这里做错了什么吗?
【问题讨论】:
-
@sommmen 是 60 秒。你的意思是握手超时也应该大于间隔?
-
我的错误——我读错了。我不确定 - 我没有触及这些设置,它们似乎适合我所做的任何事情。对不起。
标签: asp.net-core asp.net-core-signalr