server.keepAliveTimeout
-
类型:<number> 超时(以毫秒为单位)。默认值:
5000
(5 秒)。¥Type: <number> Timeout in milliseconds. Default:
5000
(5 seconds).
在完成写入最后一个响应之后,在套接字将被销毁之前,服务器需要等待额外传入数据的不活动毫秒数。
¥The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed.
此超时值与 server.keepAliveTimeoutBuffer
选项结合使用,以确定实际的套接字超时时间,计算方式如下:socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer 如果服务器在保持活动超时触发之前收到新数据,它将重置常规不活动超时,即 server.timeout
。
¥This timeout value is combined with the
server.keepAliveTimeoutBuffer
option to determine the actual socket
timeout, calculated as:
socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer
If the server receives new data before the keep-alive timeout has fired, it
will reset the regular inactivity timeout, i.e., server.timeout
.
值 0
将禁用传入连接上的保持活动超时行为。0
值使 HTTP 服务器的行为类似于 Node.js 8.0.0 之前的版本,该版本没有 keep-alive 超时。
¥A value of 0
will disable the keep-alive timeout behavior on incoming
connections.
A value of 0
makes the HTTP server behave similarly to Node.js versions prior
to 8.0.0, which did not have a keep-alive timeout.
套接字超时逻辑是在连接上设置的,因此更改此值只会影响到服务器的新连接,而不会影响任何现有连接。
¥The socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections.