Socket SO KEEPALIVE: Difference between revisions
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
Tells whether the TCP Keep-Alive mechanism is turned on for a socket. TCP Keep-Alive works as described here: {{Internal|TCP_KeepAlive#Overview|TCP Keep-Alive}} | Tells whether the TCP Keep-Alive mechanism is turned on for a socket. TCP Keep-Alive works as described here: {{Internal|TCP_KeepAlive#Overview|TCP Keep-Alive}} | ||
The value of the configuration flag can be obtained from the Socket or from the SocketChannel with: | |||
<syntaxhighlight lang='java'> | |||
supportedOptions() | |||
</syntaxhighlight> | |||
All we can do on a Java socket is to turn TCP KeepAlive on or off - apparently on a per-socket based: | All we can do on a Java socket is to turn TCP KeepAlive on or off - apparently on a per-socket based: |
Revision as of 16:58, 26 July 2018
External
Internal
Overview
Tells whether the TCP Keep-Alive mechanism is turned on for a socket. TCP Keep-Alive works as described here:
The value of the configuration flag can be obtained from the Socket or from the SocketChannel with:
supportedOptions()
All we can do on a Java socket is to turn TCP KeepAlive on or off - apparently on a per-socket based:
void setKeepAlive(boolean); boolean getKeepAlive();
The KeepAlive parameters can be only set at the operating system level.