org.apache.hc.core5.reactor

## Class IOReactorConfig.Builder

- java.lang.Object
- - org.apache.hc.core5.reactor.IOReactorConfig.Builder

- Enclosing class:
    IOReactorConfig

      public static class IOReactorConfig.Builder
      extends Object

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IOReactorConfig` | `build()`
    `static int` | `getDefaultMaxIOThreadCount()` Gets the default value for `ioThreadCount`.
    `IOReactorConfig.Builder` | `setBacklogSize(int backlogSize)` Sets the default backlog size value for server sockets binds.
    `static void` | `setDefaultMaxIOThreadCount(int defaultMaxIOThreadCount)` Sets the default value for `ioThreadCount`.
    `IOReactorConfig.Builder` | `setIoThreadCount(int ioThreadCount)` Sets the number of I/O dispatch threads to be used by the I/O reactor.
    `IOReactorConfig.Builder` | `setRcvBufSize(int rcvBufSize)` Sets the default value of the `SocketOptions.SO_RCVBUF` parameter for newly created sockets.
    `IOReactorConfig.Builder` | `setSelectInterval(TimeValue selectInterval)` Sets time interval at which the I/O reactor wakes up to check for timed out sessions and session requests.
    `IOReactorConfig.Builder` | `setSndBufSize(int sndBufSize)` Sets the default value of the `SocketOptions.SO_SNDBUF` parameter for newly created sockets.
    `IOReactorConfig.Builder` | `setSocksProxyAddress(SocketAddress socksProxyAddress)` Sets the address of the SOCKS proxy to use.
    `IOReactorConfig.Builder` | `setSocksProxyPassword(String socksProxyPassword)` Sets the password to provide to the SOCKS proxy for username/password authentication.
    `IOReactorConfig.Builder` | `setSocksProxyUsername(String socksProxyUsername)` Sets the username to provide to the SOCKS proxy for username/password authentication.
    `IOReactorConfig.Builder` | `setSoKeepAlive(boolean soKeepAlive)` Sets the default value of the `SocketOptions.SO_KEEPALIVE` parameter for newly created sockets.
    `IOReactorConfig.Builder` | `setSoLinger(int soLinger, TimeUnit timeUnit)` Sets the default value of the `SocketOptions.SO_LINGER` parameter for newly created sockets.
    `IOReactorConfig.Builder` | `setSoLinger(TimeValue soLinger)` Sets the default value of the `SocketOptions.SO_LINGER` parameter for newly created sockets.
    `IOReactorConfig.Builder` | `setSoReuseAddress(boolean soReuseAddress)` Sets the default value of the `SocketOptions.SO_REUSEADDR` parameter for newly created sockets.
    `IOReactorConfig.Builder` | `setSoTimeout(int soTimeout, TimeUnit timeUnit)` Sets the default socket timeout value for non-blocking I/O operations.
    `IOReactorConfig.Builder` | `setSoTimeout(Timeout soTimeout)` Sets the default socket timeout value for non-blocking I/O operations.
    `IOReactorConfig.Builder` | `setTcpKeepCount(int tcpKeepCount)` Sets the maximum number of keepalive probes TCP should send before dropping the connection.
    `IOReactorConfig.Builder` | `setTcpKeepIdle(int tcpKeepIdle)` Sets the time (in seconds) the connection needs to remain idle before TCP starts sending keepalive probes.
    `IOReactorConfig.Builder` | `setTcpKeepInterval(int tcpKeepInterval)` Sets the time (in seconds) between individual keepalive probes.
    `IOReactorConfig.Builder` | `setTcpNoDelay(boolean tcpNoDelay)` Sets the default value of the `SocketOptions.TCP_NODELAY` parameter for newly created sockets.
    `IOReactorConfig.Builder` | `setTrafficClass(int trafficClass)` Sets the default value of the `SocketOptions.IP_TOS` 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

    - #### getDefaultMaxIOThreadCount

          public static int getDefaultMaxIOThreadCount()

      Gets the default value for `ioThreadCount`. Returns `Runtime.availableProcessors()` if `setDefaultMaxIOThreadCount(int)` was called with a value less <= 0.
      Returns:
        the default value for ioThreadCount.
      Since:
        4.4.10

    - #### setDefaultMaxIOThreadCount

          public static void setDefaultMaxIOThreadCount(int defaultMaxIOThreadCount)

      Sets the default value for `ioThreadCount`. Use a value <= 0 to cause `getDefaultMaxIOThreadCount()` to return `Runtime.availableProcessors()`.
      Parameters:
        `defaultMaxIOThreadCount` - the default value for ioThreadCount.
      Since:
        4.4.10

    - #### setSelectInterval

          public IOReactorConfig.Builder setSelectInterval(TimeValue selectInterval)

      Sets time interval at which the I/O reactor wakes up to check for timed out sessions and session requests.

      Default: `1000` milliseconds.

      Returns:
        this instance.

    - #### setIoThreadCount

          public IOReactorConfig.Builder setIoThreadCount(int ioThreadCount)

      Sets the number of I/O dispatch threads to be used by the I/O reactor.

      Default: `2`

      Returns:
        this instance.

    - #### setSoTimeout

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

      Sets the default socket timeout value for non-blocking I/O operations.

      Default: `0` (no timeout)

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_TIMEOUT`

    - #### setSoTimeout

          public IOReactorConfig.Builder setSoTimeout(Timeout soTimeout)

      Sets the default socket timeout value for non-blocking I/O operations.

      Default: `0` (no timeout)

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_TIMEOUT`

    - #### setSoReuseAddress

          public IOReactorConfig.Builder setSoReuseAddress(boolean soReuseAddress)

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

      Default: `false`

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_REUSEADDR`

    - #### setSoLinger

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

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

      Default: `-1`

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_LINGER`

    - #### setSoLinger

          public IOReactorConfig.Builder setSoLinger(TimeValue soLinger)

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

      Default: `-1`

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_LINGER`

    - #### setSoKeepAlive

          public IOReactorConfig.Builder setSoKeepAlive(boolean soKeepAlive)

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

      Default: `-1`

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_KEEPALIVE`

    - #### setTcpNoDelay

          public IOReactorConfig.Builder setTcpNoDelay(boolean tcpNoDelay)

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

      Default: `false`

      Returns:
        this instance.
      See Also:
        `SocketOptions.TCP_NODELAY`

    - #### setTrafficClass

          public IOReactorConfig.Builder setTrafficClass(int trafficClass)

      Sets the default value of the `SocketOptions.IP_TOS` parameter for newly created sockets.

      Default: `0`

      Returns:
        this instance.
      Since:
        5.1
      See Also:
        `SocketOptions.IP_TOS`

    - #### setSndBufSize

          public IOReactorConfig.Builder setSndBufSize(int sndBufSize)

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

      Default: `0` (system default)

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_SNDBUF`

    - #### setRcvBufSize

          public IOReactorConfig.Builder setRcvBufSize(int rcvBufSize)

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

      Default: `0` (system default)

      Returns:
        this instance.
      See Also:
        `SocketOptions.SO_RCVBUF`

    - #### setBacklogSize

          public IOReactorConfig.Builder setBacklogSize(int backlogSize)

      Sets the default backlog size value for server sockets binds.

      Default: `0` (system default)

      Returns:
        this instance.
      Since:
        4.4

    - #### setTcpKeepIdle

          public IOReactorConfig.Builder setTcpKeepIdle(int tcpKeepIdle)

      Sets the time (in seconds) the connection needs to remain idle before TCP starts sending keepalive probes.
      Returns:
        this instance.
      Since:
        5.3

    - #### setTcpKeepInterval

          public IOReactorConfig.Builder setTcpKeepInterval(int tcpKeepInterval)

      Sets the time (in seconds) between individual keepalive probes.
      Returns:
        this instance.
      Since:
        5.3

    - #### setTcpKeepCount

          public IOReactorConfig.Builder setTcpKeepCount(int tcpKeepCount)

      Sets the maximum number of keepalive probes TCP should send before dropping the connection.
      Returns:
        this instance.
      Since:
        5.3

    - #### setSocksProxyAddress

          public IOReactorConfig.Builder setSocksProxyAddress(SocketAddress socksProxyAddress)

      Sets the address of the SOCKS proxy to use.
      Returns:
        this instance.

    - #### setSocksProxyUsername

          public IOReactorConfig.Builder setSocksProxyUsername(String socksProxyUsername)

      Sets the username to provide to the SOCKS proxy for username/password authentication.
      Returns:
        this instance.

    - #### setSocksProxyPassword

          public IOReactorConfig.Builder setSocksProxyPassword(String socksProxyPassword)

      Sets the password to provide to the SOCKS proxy for username/password authentication.
      Returns:
        this instance.

    - #### build

          public IOReactorConfig build()

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