Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core AspNet核心信号器保持生存超时的一些问题_Asp.net Core_Asp.net Core Signalr - Fatal编程技术网

Asp.net core AspNet核心信号器保持生存超时的一些问题

Asp.net core AspNet核心信号器保持生存超时的一些问题,asp.net-core,asp.net-core-signalr,Asp.net Core,Asp.net Core Signalr,在我们的项目中,我将信号机设置如下: services.AddSignalR() .AddHubOptions<NotificationHub>(options => { const int keepAliveIntervalInSeconds=60; options.EnableDetailedErrors=true; options

在我们的项目中,我将信号机设置如下:

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);
            });
这里有什么我做错的吗

错误:连接已断开,错误为“错误:服务器超时,但未收到服务器的消息。”

在中,我们可以发现:

KeepAliveInterval
的默认值为15秒。更改
KeepAliveInterval
时,我们还需要更改客户端的
ServerTimeout/servertimeoutinmillizes
设置。并且建议的
ServerTimeout/servertimeoutinmillizes
值是
KeepAliveInterval
值的两倍


默认超时值为30000毫秒(30秒),如果您只需将信号器集线器的
KeepAliveInterval
设置更新为60秒,但不更改客户端的
servertimeoutingmillizes
值,则会导致上述错误。

@sommen这是60秒。你的意思是握手超时也应该大于间隔吗?我错了,我看错了。我不确定-我没有接触过这些设置,它们似乎适合我做的任何事情。对不起,原来客户端的设置足以满足我的要求。
[2020-06-03T09:48:44.367Z] Error: Connection disconnected with error 'Error: Server timeout elapsed without receiving a message from the server.'.