I have the following situation:
- Application (Firebird DB client) on a client computer opens a TCP connection to server on port 3050
- Application crash on client, application terminated
- netstat on the server still shows TCP-connection ESTABLISHED on port 3050 to clients ip address.
- powered off client
- netstat on the server still shows TCP-connection ESTABLISHED on port 3050 to clients ip address.
- waited several minutes
- netstat on the server still shows TCP-connection ESTABLISHED on port 3050 to clients ip address.
Is there a timeout for established connections under Windows (Win8.1 in this case)?
Can I change this timeout?
I found this, but this does not seem to answer my question for established connections.
Best Answer
By default an established TCP connection does not time out (but may do so because of hardware restrictions).
An application can use the TCP keepalive mechanism to check for broken connections. In Firebird (>1.5) TCP keepalives are enabled.
The keepalive "timeout" has to be set on the server. The default TCP keepalive time interval in Windows is 2 hours (but recommended are 5 minutes). It can be set in the
HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\KeepAliveTime
registry key.More details from above links:
With following corresponding registry values in Windows:
But: