Class NetUtils
java.lang.Object
org.elasticsearch.core.internal.net.NetUtils
Utilities for network-related methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SocketOption<Integer>
Returns the extended TCP_KEEPCOUNT socket option, if available on this JDKstatic SocketOption<Integer>
Returns the extended TCP_KEEPIDLE socket option, if available on this JDKstatic SocketOption<Integer>
Returns the extended TCP_KEEPINTERVAL socket option, if available on this JDKstatic void
tryEnsureReasonableKeepAliveConfig(NetworkChannel socketChannel)
If SO_KEEPALIVE is enabled (default), this method ensures sane default values for the extended socket options TCP_KEEPIDLE and TCP_KEEPINTERVAL.
-
Constructor Details
-
NetUtils
public NetUtils()
-
-
Method Details
-
getTcpKeepIdleSocketOptionOrNull
Returns the extended TCP_KEEPIDLE socket option, if available on this JDK -
getTcpKeepIntervalSocketOptionOrNull
Returns the extended TCP_KEEPINTERVAL socket option, if available on this JDK -
getTcpKeepCountSocketOptionOrNull
Returns the extended TCP_KEEPCOUNT socket option, if available on this JDK -
tryEnsureReasonableKeepAliveConfig
If SO_KEEPALIVE is enabled (default), this method ensures sane default values for the extended socket options TCP_KEEPIDLE and TCP_KEEPINTERVAL. The default value for TCP_KEEPIDLE is system dependent, but is typically 2 hours. Such a high value can result in firewalls eagerly closing these connections. To tell any intermediate devices that the connection remains alive, we explicitly set these options to 5 minutes if the defaults are higher than that.
-