阅读 Node 的关于 server.keepAliveTimeout 的文档:
If the server receives new data before the keep-alive timeout has fired, it will reset the regular inactivity timeout, i.e., server.timeout.
这与 server.timeout 有何不同? ?
听起来他们都是关于套接字超时的,只有在不活动时才开始打勾。
最佳答案
Keep-Alive
是 Http 协议(protocol)的 header 部分。 Keep-Alive
header 将允许通过单个连接发送多个 Http 请求,而不是使用多个。
因此,设置 keepAliveTimeout
将决定这些 Keep-Alive
连接允许保持打开状态的时间。 timeout
决定服务器等待客户端响应的最长时间。
关于 Keep-Alive
的更多信息可以在这里找到:https://blog.stackpath.com/glossary-keep-alive/
关于node.js - keepAliveTimeout 和超时之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56606305/