Interface ConnectionConfig

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
ConnectionConfig.BuilderBase.ConnectionConfigImpl

public interface ConnectionConfig extends Prototype.Api
Configuration of a server connection (for each connection created by clients).
See Also:
  • Field Details

    • DEFAULT_READ_TIMEOUT_DURATION

      static final String DEFAULT_READ_TIMEOUT_DURATION
      Default read timeout duration.
      See Also:
    • DEFAULT_CONNECT_TIMEOUT_DURATION

      static final String DEFAULT_CONNECT_TIMEOUT_DURATION
      Default connect timeout duration.
      See Also:
    • DEFAULT_SO_BUFFER_SIZE

      static final int DEFAULT_SO_BUFFER_SIZE
      Default SO buffer size.
      See Also:
  • Method Details

    • builder

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

      static ConnectionConfig.Builder builder(ConnectionConfig 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 ConnectionConfig 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 ConnectionConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • readTimeout

      Duration readTimeout()
      Read timeout. Default is "PT30S"
      Returns:
      read timeout
    • connectTimeout

      Duration connectTimeout()
      Connect timeout. Default is "PT10S".
      Returns:
      connect timeout
    • sendBufferSize

      int sendBufferSize()
      Socket send buffer size. Default is 32768.
      Returns:
      buffer size, in bytes
      See Also:
    • receiveBufferSize

      int receiveBufferSize()
      Socket receive buffer size. Default is 32768.
      Returns:
      buffer size, in bytes
      See Also:
    • keepAlive

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

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

      boolean tcpNoDelay()
      Disable Nagle's algorithm by setting TCP_NODELAY to true. This can result in better performance on Mac or newer linux kernels for some payload types. Default is false.
      Returns:
      whether to use TCP_NODELAY, defaults to false
      See Also:
    • socketOptions

      Map<SocketOption<?>,Object> socketOptions()
      Set an arbitrary socket option. A mapping of a socket option to its value. Socket options may be system specific. Most commonly supported socket options are available as methods directly.
      Returns:
      socket options
      See Also: