Class SocketSettings.Builder

  • Enclosing class:
    SocketSettings

    public static final class SocketSettings.Builder
    extends 
    A builder for an instance of SocketSettings.
    • Method Detail

      • applySettings

        public SocketSettings.Builder applySettings​(SocketSettings socketSettings)
        Applies the socketSettings to the builder

        Note: Overwrites all existing settings

        Parameters:
        socketSettings - the socketSettings
        Returns:
        this
        Since:
        3.7
      • connectTimeout

        public SocketSettings.Builder connectTimeout​(int connectTimeout,
                                                      timeUnit)
        Sets the socket connect timeout.
        Parameters:
        connectTimeout - the connect timeout
        timeUnit - the time unit
        Returns:
        this
      • readTimeout

        public SocketSettings.Builder readTimeout​(int readTimeout,
                                                   timeUnit)
        Sets the socket read timeout.
        Parameters:
        readTimeout - the read timeout
        timeUnit - the time unit
        Returns:
        this
      • keepAlive

        public SocketSettings.Builder keepAlive​(boolean keepAlive)
        Deprecated.
        configuring keep-alive has been deprecated. It now defaults to true and disabling it is not recommended.
        Sets keep-alive.
        Parameters:
        keepAlive - false if keep-alive should be disabled
        Returns:
        this
        See Also:
      • receiveBufferSize

        public SocketSettings.Builder receiveBufferSize​(int receiveBufferSize)
        Sets the receive buffer size.
        Parameters:
        receiveBufferSize - the receive buffer size
        Returns:
        this
      • sendBufferSize

        public SocketSettings.Builder sendBufferSize​(int sendBufferSize)
        Sets the send buffer size.
        Parameters:
        sendBufferSize - the send buffer size
        Returns:
        this
      • build

        public SocketSettings build()
        Build an instance of SocketSettings.
        Returns:
        the socket settings for this builder