Class TcpClientSocketOptions


  • public final class TcpClientSocketOptions
    extends Object
    Defines socket options used to configure a TCP client socket.

    Socket options are applied when the TCP client creates its socket. Except where KDC provides an explicit default, an option value of null leaves the corresponding socket setting unchanged.

    By default, TCP keep-alive is enabled and SO_LINGER is enabled with a linger time of zero seconds. All other socket options are left unchanged unless explicitly configured.

    Instances are created using the TcpClientSocketOptions.Builder.

    Author:
    Charles B. Kozoyed
    See Also:
    TcpClientSocketOptions.Builder, SocketConfigurator
    • Method Detail

      • getKeepAlive

        public Boolean getKeepAlive()
        Returns whether TCP keep-alive is enabled.
        Returns:
        true if TCP keep-alive is enabled, false if disabled, or null if the socket setting should remain unchanged
      • getReuseAddress

        public Boolean getReuseAddress()
        Returns whether the socket address may be reused.
        Returns:
        true if address reuse is enabled, false if disabled, or null if the socket setting should remain unchanged
      • getReceiveBufferSize

        public Integer getReceiveBufferSize()
        Returns the configured socket receive buffer size.
        Returns:
        the receive buffer size in bytes, or null if the socket setting should remain unchanged
      • getSendBufferSize

        public Integer getSendBufferSize()
        Returns the configured socket send buffer size.
        Returns:
        the send buffer size in bytes, or null if the socket setting should remain unchanged
      • getSoTimeout

        public Integer getSoTimeout()
        Returns the configured socket read timeout.
        Returns:
        the socket read timeout in milliseconds, or null if the socket setting should remain unchanged
      • getSoLingerOn

        public Boolean getSoLingerOn()
        Returns whether SO_LINGER is enabled.
        Returns:
        true if SO_LINGER is enabled, false if disabled, or null if the socket setting should remain unchanged
      • getSoLingerTime

        public Integer getSoLingerTime()
        Returns the configured SO_LINGER time.
        Returns:
        the linger time in seconds, or null if the socket setting should remain unchanged
      • getTcpNoDelay

        public Boolean getTcpNoDelay()
        Returns whether the Nagle algorithm is disabled for the socket.
        Returns:
        true if the Nagle algorithm is disabled, false if enabled, or null if the socket setting should remain unchanged
      • getTrafficClass

        public Integer getTrafficClass()
        Returns the configured IP traffic class.
        Returns:
        the IP traffic class value, or null if the socket setting should remain unchanged
      • getOobInline

        public Boolean getOobInline()
        Returns whether received TCP urgent data is placed inline with normal socket data.
        Returns:
        true if urgent data is received inline, false otherwise, or null if the socket setting should remain unchanged