org.apache.hc.core5.http.io

## Class SocketConfig.Builder

- java.lang.Object
- - org.apache.hc.core5.http.io.SocketConfig.Builder

- Enclosing class:
    SocketConfig

      public static class SocketConfig.Builder
      extends Object

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SocketConfig` | `build()`
    `SocketConfig.Builder` | `setBacklogSize(int backlogSize)` Determines the maximum queue length for incoming connection indications (a request to connect) also known as server socket backlog.
    `SocketConfig.Builder` | `setRcvBufSize(int rcvBufSize)` Determines the default value of the `SocketOptions.SO_RCVBUF` parameter for newly created sockets.
    `SocketConfig.Builder` | `setSndBufSize(int sndBufSize)` Determines the default value of the `SocketOptions.SO_SNDBUF` parameter for newly created sockets.
    `SocketConfig.Builder` | `setSocksProxyAddress(SocketAddress socksProxyAddress)` The address of the SOCKS proxy to use.
    `SocketConfig.Builder` | `setSoKeepAlive(boolean soKeepAlive)` Determines the default value of the `SocketOptions.SO_KEEPALIVE` parameter for newly created sockets.
    `SocketConfig.Builder` | `setSoLinger(int soLinger, TimeUnit timeUnit)`
    `SocketConfig.Builder` | `setSoLinger(TimeValue soLinger)` Determines the default value of the `SocketOptions.SO_LINGER` parameter for newly created sockets.
    `SocketConfig.Builder` | `setSoReuseAddress(boolean soReuseAddress)` Determines the default value of the `SocketOptions.SO_REUSEADDR` parameter for newly created sockets.
    `SocketConfig.Builder` | `setSoTimeout(int soTimeout, TimeUnit timeUnit)`
    `SocketConfig.Builder` | `setSoTimeout(Timeout soTimeout)` Determines the default socket timeout value for blocking I/O operations.
    `SocketConfig.Builder` | `setTcpNoDelay(boolean tcpNoDelay)` Determines the default value of the `SocketOptions.TCP_NODELAY` parameter for newly created sockets.

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

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

- - ### Method Detail

    - #### setSoTimeout

          public SocketConfig.Builder setSoTimeout(int soTimeout,
                                                   TimeUnit timeUnit)

      See Also:
        `setSoTimeout(Timeout)`

    - #### setSoTimeout

          public SocketConfig.Builder setSoTimeout(Timeout soTimeout)

      Determines the default socket timeout value for blocking I/O operations.

      Default: 3 minutes

      Returns:
        the default socket timeout value for blocking I/O operations.
      See Also:
        `SocketOptions.SO_TIMEOUT`

    - #### setSoReuseAddress

          public SocketConfig.Builder setSoReuseAddress(boolean soReuseAddress)

      Determines the default value of the `SocketOptions.SO_REUSEADDR` parameter for newly created sockets.

      Default: `false`

      Returns:
        the default value of the `SocketOptions.SO_REUSEADDR` parameter.
      See Also:
        `SocketOptions.SO_REUSEADDR`

    - #### setSoLinger

          public SocketConfig.Builder setSoLinger(int soLinger,
                                                  TimeUnit timeUnit)

      See Also:
        `setSoLinger(TimeValue)`

    - #### setSoLinger

          public SocketConfig.Builder setSoLinger(TimeValue soLinger)

      Determines the default value of the `SocketOptions.SO_LINGER` parameter for newly created sockets.

      Default: `-1`

      Returns:
        the default value of the `SocketOptions.SO_LINGER` parameter.
      See Also:
        `SocketOptions.SO_LINGER`

    - #### setSoKeepAlive

          public SocketConfig.Builder setSoKeepAlive(boolean soKeepAlive)

      Determines the default value of the `SocketOptions.SO_KEEPALIVE` parameter for newly created sockets.

      Default: `false`

      Returns:
        the default value of the `SocketOptions.SO_KEEPALIVE` parameter.
      See Also:
        `SocketOptions.SO_KEEPALIVE`

    - #### setTcpNoDelay

          public SocketConfig.Builder setTcpNoDelay(boolean tcpNoDelay)

      Determines the default value of the `SocketOptions.TCP_NODELAY` parameter for newly created sockets.

      Default: `false`

      Returns:
        the default value of the `SocketOptions.TCP_NODELAY` parameter.
      See Also:
        `SocketOptions.TCP_NODELAY`

    - #### setSndBufSize

          public SocketConfig.Builder setSndBufSize(int sndBufSize)

      Determines the default value of the `SocketOptions.SO_SNDBUF` parameter for newly created sockets.

      Default: `0` (system default)

      Returns:
        the default value of the `SocketOptions.SO_SNDBUF` parameter.
      Since:
        4.4
      See Also:
        `SocketOptions.SO_SNDBUF`

    - #### setRcvBufSize

          public SocketConfig.Builder setRcvBufSize(int rcvBufSize)

      Determines the default value of the `SocketOptions.SO_RCVBUF` parameter for newly created sockets.

      Default: `0` (system default)

      Returns:
        the default value of the `SocketOptions.SO_RCVBUF` parameter.
      Since:
        4.4
      See Also:
        `SocketOptions.SO_RCVBUF`

    - #### setBacklogSize

          public SocketConfig.Builder setBacklogSize(int backlogSize)

      Determines the maximum queue length for incoming connection indications (a request to connect) also known as server socket backlog.

      Default: `0` (system default)

      Returns:
        the maximum queue length for incoming connection indications
      Since:
        4.4

    - #### setSocksProxyAddress

          public SocketConfig.Builder setSocksProxyAddress(SocketAddress socksProxyAddress)

      The address of the SOCKS proxy to use.

    - #### build

          public SocketConfig build()

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.