views:

118

answers:

1

after the connection has been established, and the two sides have no communication, which timeout value determins the idle connection be closed?

A: 

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.

Will