开发者

Which timeout value determins how long will the idle TCP connection will be closed?

开发者 https://www.devze.com 2022-12-14 08:13 出处:网络
After the connection has been established, and the two sides have no communication, which timeout value determines the idle connection be close开发者_高级运维d?In general, none.It is the programmer\'s

After the connection has been established, and the two sides have no communication, which timeout value determines the idle connection be close开发者_高级运维d?


In general, none. It is the programmer's and protocol-designer's responsibility to specify, implement and enforce any timeouts at an application level.

However, all kinds of things can happen to cause outages and other network connectivity issues. It is not possible to determine if a TCP connection is idle, or if the other end is unreachable, unless you're trying to send something.

For this reason, most servers with long-standing connections contain simple polls such as sending empty packets or such every so-often just to detect lack of connectivity.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号