com.hazelcast.client.config

## Class SocketOptions

- java.lang.Object
- - com.hazelcast.client.config.SocketOptions

-     public class SocketOptions
      extends Object

  TCP Socket options

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_BUFFER_SIZE_BYTE` default buffer size of Bytes
    `static int` | `KILO_BYTE` constant for kilobyte

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SocketOptions()`
    `SocketOptions(SocketOptions socketOptions)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `getBufferSize()` Gets the SO_SNDBUF and SO_RCVBUF option value
    `int` | `getLingerSeconds()` Gets SO_LINGER with the specified linger time in seconds
    `int` | `hashCode()`
    `boolean` | `isKeepAlive()` SO_KEEPALIVE socket option
    `boolean` | `isReuseAddress()` SO_REUSEADDR socket option.
    `boolean` | `isTcpNoDelay()` TCP_NODELAY socket option
    `SocketOptions` | `setBufferSize(int bufferSize)` Sets the SO_SNDBUF and SO_RCVBUF options to the specified value in KB
    `SocketOptions` | `setKeepAlive(boolean keepAlive)` Enable/disable SO_KEEPALIVE socket option.
    `SocketOptions` | `setLingerSeconds(int lingerSeconds)` Enable/disable SO_LINGER with the specified linger time in seconds If set to a value of 0 or less then it is disabled.
    `SocketOptions` | `setReuseAddress(boolean reuseAddress)` Enable/disable the SO_REUSEADDR socket option.
    `SocketOptions` | `setTcpNoDelay(boolean tcpNoDelay)` Enable/disable TCP_NODELAY socket option.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### KILO_BYTE

          public static final int KILO_BYTE

      constant for kilobyte
      See Also:
        Constant Field Values

    - #### DEFAULT_BUFFER_SIZE_BYTE

          public static final int DEFAULT_BUFFER_SIZE_BYTE

      default buffer size of Bytes
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SocketOptions

          public SocketOptions()

    - #### SocketOptions

          public SocketOptions(SocketOptions socketOptions)

  - ### Method Detail

    - #### isTcpNoDelay

          public boolean isTcpNoDelay()

      TCP_NODELAY socket option
      Returns:
        true if enabled

    - #### setTcpNoDelay

          public SocketOptions setTcpNoDelay(boolean tcpNoDelay)

      Enable/disable TCP_NODELAY socket option.
      Parameters:
        `tcpNoDelay` -
      Returns:

    - #### isKeepAlive

          public boolean isKeepAlive()

      SO_KEEPALIVE socket option
      Returns:
        true if enabled

    - #### setKeepAlive

          public SocketOptions setKeepAlive(boolean keepAlive)

      Enable/disable SO_KEEPALIVE socket option.
      Parameters:
        `keepAlive` - enabled if true
      Returns:
        SocketOptions configured

    - #### isReuseAddress

          public boolean isReuseAddress()

      SO_REUSEADDR socket option.
      Returns:
        true if enabled

    - #### setReuseAddress

          public SocketOptions setReuseAddress(boolean reuseAddress)

      Enable/disable the SO_REUSEADDR socket option.
      Parameters:
        `reuseAddress` - enabled if true
      Returns:
        SocketOptions configured

    - #### getLingerSeconds

          public int getLingerSeconds()

      Gets SO_LINGER with the specified linger time in seconds
      Returns:
        lingerSeconds value in seconds

    - #### setLingerSeconds

          public SocketOptions setLingerSeconds(int lingerSeconds)

      Enable/disable SO_LINGER with the specified linger time in seconds If set to a value of 0 or less then it is disabled. Default value is `DEFAULT_LINGER_SECONDS`
      Parameters:
        `lingerSeconds` - value in seconds
      Returns:
        SocketOptions configured

    - #### getBufferSize

          public int getBufferSize()

      Gets the SO_SNDBUF and SO_RCVBUF option value
      Returns:
        bufferSize KB value

    - #### setBufferSize

          public SocketOptions setBufferSize(int bufferSize)

      Sets the SO_SNDBUF and SO_RCVBUF options to the specified value in KB
      Parameters:
        `bufferSize` - KB value
      Returns:
        SocketOptions configured

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2020. All rights reserved.