Class TcpServerSocketOptions.Builder

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for configuring TCP server socket options.
    • Method Detail

      • withReuseAddress

        public TcpServerSocketOptions.Builder withReuseAddress​(Boolean reuseAddress)
        Sets whether the server socket allows reuse of the local address.

        The default is false.

        Parameters:
        reuseAddress - true to allow address reuse; false otherwise
        Returns:
        this builder
      • withReceiveBufferSize

        public TcpServerSocketOptions.Builder withReceiveBufferSize​(Integer receiveBufferSize)
        Sets the receive buffer size for the server socket.

        A null value leaves the receive buffer size at the underlying socket default.

        Parameters:
        receiveBufferSize - the receive buffer size in bytes, or null to use the underlying socket default
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if receiveBufferSize is less than or equal to zero
      • withSoTimeout

        public TcpServerSocketOptions.Builder withSoTimeout​(Integer soTimeout)
        Sets the timeout for server socket operations.

        A timeout of zero indicates an infinite timeout. A null value leaves the timeout at the underlying socket default.

        Parameters:
        soTimeout - the timeout in milliseconds, or null to use the underlying socket default
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if soTimeout is negative
      • build

        public TcpServerSocketOptions build()
        Builds the TCP server socket options.
        Returns:
        the configured TCP server socket options