java.lang.Object
org.elasticsearch.transport.netty4.NetUtils
Utilities for network-related methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SocketOption<Integer> Returns the extended TCP_KEEPCOUNT socket option.static SocketOption<Integer> Returns the extended TCP_KEEPIDLE socket option.static SocketOption<Integer> Returns the extended TCP_KEEPINTERVAL socket option.static voidtryEnsureReasonableKeepAliveConfig(NetworkChannel socketChannel) If SO_KEEPALIVE is enabled (default), this method ensures sane default values for the extended socket options TCP_KEEPIDLE and TCP_KEEPINTERVAL.
-
Method Details
-
getTcpKeepIdleSocketOption
Returns the extended TCP_KEEPIDLE socket option. -
getTcpKeepIntervalSocketOption
Returns the extended TCP_KEEPINTERVAL socket option. -
getTcpKeepCountSocketOption
Returns the extended TCP_KEEPCOUNT socket option. -
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.
-