configuring TCP keep alive in java on windows platform
806574Oct 19 2010 — edited Oct 21 2010By default, the TCP keep alive time seems to be about 2 hrs(http://download-llnw.oracle.com/javase/6/docs/api/java/net/SocketOptions.html#SO_KEEPALIVE). I want to configure it to a lower value so that the connection is not closed by routers/firewalls assuming the connection to be idle. Updating the following registry settings on windows and restarting the machine seems to work.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\KeepAliveTime 30000
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\KeepAliveInterval 1000
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpMaxDataRetransmission 10
Is there a standard way in which the keep alive time can be configured on all OS platforms?
If not, is this a standard way of changing keep alive time for java applications on windows?
Is it necessary that the machine be restarted on changing keep alive time or is there a specific time by which the new keep alive time would be picked up during run time or on restarting the java application?