Interface SocketConfiguration.SocketConfigurationBuilder<B extends SocketConfiguration.SocketConfigurationBuilder<B>>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      B backlog​(int backlog)
      Configures a maximum length of the queue of incoming connections on the server socket.
      default B bindAddress​(String address)
      Configures local address where the server listens on with the server socket.
      B bindAddress​(InetAddress bindAddress)
      Configures local address where the server listens on with the server socket.
      default B config​(Config config)
      Update this socket configuration from a Config.
      default B host​(String address)
      A helper method that just calls bindAddress(String).
      B port​(int port)
      Configures a server port to listen on with the server socket.
      B receiveBufferSize​(int receiveBufferSize)
      Configures proposed value of the TCP receive window that is advertised to the remote peer on the server socket.
      B timeout​(long amount, TimeUnit unit)
      Configures a server socket timeout.
      B tls​(TlsConfig tlsConfig)
      Configures SSL for this socket.
      default B tls​(Supplier<TlsConfig> tlsConfig)
      Configures SSL for this socket.
    • Method Detail

      • port

        B port​(int port)
        Configures a server port to listen on with the server socket. If port is 0 then any available ephemeral port will be used.
        Parameters:
        port - the server port of the server socket
        Returns:
        this builder
      • bindAddress

        default B bindAddress​(String address)
        Configures local address where the server listens on with the server socket. If not configured, then listens an all local addresses.
        Parameters:
        address - an address to bind with the server socket
        Returns:
        this builder
        Throws:
        NullPointerException - in case the bind address is null
        ConfigException - in case the address provided is not a valid host address
      • host

        default B host​(String address)
        A helper method that just calls bindAddress(String).
        Parameters:
        address - host to listen on
        Returns:
        this builder
      • bindAddress

        B bindAddress​(InetAddress bindAddress)
        Configures local address where the server listens on with the server socket. If not configured, then listens an all local addresses.
        Parameters:
        bindAddress - an address to bind with the server socket
        Returns:
        this builder
        Throws:
        NullPointerException - in case the bind address is null
      • backlog

        B backlog​(int backlog)
        Configures a maximum length of the queue of incoming connections on the server socket.

        Default value is SocketConfiguration.DEFAULT_BACKLOG_SIZE.

        Parameters:
        backlog - a maximum length of the queue of incoming connections
        Returns:
        this builder
      • timeout

        B timeout​(long amount,
                  TimeUnit unit)
        Configures a server socket timeout.
        Parameters:
        amount - an amount of time to configure the timeout, use 0 for infinite timeout
        unit - time unit to use with the configured amount
        Returns:
        this builder
      • receiveBufferSize

        B receiveBufferSize​(int receiveBufferSize)
        Configures proposed value of the TCP receive window that is advertised to the remote peer on the server socket.

        If 0 then use implementation default.

        Parameters:
        receiveBufferSize - a buffer size in bytes of the server socket or 0
        Returns:
        this builder
      • tls

        B tls​(TlsConfig tlsConfig)
        Configures SSL for this socket. When configured, the server enforces SSL configuration. If this method is called, any other method except for tls(java.util.function.Supplier)ยจ and repeated invocation of this method would be ignored.

        If this method is called again, the previous configuration would be ignored.

        Parameters:
        tlsConfig - ssl configuration to use with this socket
        Returns:
        this builder
      • tls

        default B tls​(Supplier<TlsConfig> tlsConfig)
        Configures SSL for this socket. When configured, the server enforces SSL configuration.
        Parameters:
        tlsConfig - supplier ssl configuration to use with this socket
        Returns:
        this builder
      • config

        default B config​(Config config)
        Update this socket configuration from a Config.
        Parameters:
        config - configuration on the node of a socket
        Returns:
        updated builder instance