Interface SocketOptions

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
SocketOptions.BuilderBase.SocketOptionsImpl

public interface SocketOptions extends Prototype.Api
Socket options.
See Also:
  • Method Details

    • builder

      static SocketOptions.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static SocketOptions.Builder builder(SocketOptions instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static SocketOptions create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static SocketOptions create()
      Create a new instance with default values.
      Returns:
      a new instance
    • socketOptions

      Map<SocketOption<?>,Object> socketOptions()
      Arbitrary socket options. Socket options that have dedicated methods in this type will be ignored if configured within the map.
      Returns:
      custom socket options
    • connectTimeout

      Duration connectTimeout()
      Socket connect timeout. Default is 10 seconds.
      Returns:
      connect timeout duration
    • readTimeout

      Duration readTimeout()
      Socket read timeout. Default is 30 seconds.
      Returns:
      read timeout duration
    • socketReceiveBufferSize

      Optional<Integer> socketReceiveBufferSize()
      Socket receive buffer size.
      Returns:
      buffer size, in bytes
      See Also:
    • socketSendBufferSize

      Optional<Integer> socketSendBufferSize()
      Socket send buffer size.
      Returns:
      buffer size, in bytes
      See Also:
    • socketReuseAddress

      boolean socketReuseAddress()
      Socket reuse address. Default is true.
      Returns:
      whether to reuse address
      See Also:
    • socketKeepAlive

      boolean socketKeepAlive()
      Configure socket keep alive. Default is true.
      Returns:
      keep alive
      See Also:
    • tcpNoDelay

      boolean tcpNoDelay()
      This option may improve performance on some systems. Default is false.
      Returns:
      whether to use TCP_NODELAY, defaults to false
      See Also:
    • configureSocket

      default void configureSocket(Socket socket)
      Configure socket with defined socket options.
      Parameters:
      socket - socket to update