Class TcpServerConfig


@Unstable public class TcpServerConfig extends TcpEndpointConfig
Configuration of a NetServer
Author:
Julien Viet
  • Constructor Details

    • TcpServerConfig

      public TcpServerConfig()
    • TcpServerConfig

      public TcpServerConfig(TcpServerConfig other)
    • TcpServerConfig

      public TcpServerConfig(NetServerOptions options)
  • Method Details

    • setIdleTimeout

      public TcpServerConfig setIdleTimeout(Duration idleTimeout)
      Description copied from class: EndpointConfig
      Set the stream idle timeout, zero or null means don't time out. This determines if a stream will timeout and be closed if no data is received nor sent within the timeout.
      Overrides:
      setIdleTimeout in class TcpEndpointConfig
      Parameters:
      idleTimeout - the idle timeout
      Returns:
      a reference to this, so the API can be used fluently
    • setReadIdleTimeout

      public TcpServerConfig setReadIdleTimeout(Duration idleTimeout)
      Description copied from class: EndpointConfig

      Set the stream read idle timeout, zero or null means or null means don't time out. This determines if a stream will timeout and be closed if no data is received within the timeout.

      Overrides:
      setReadIdleTimeout in class TcpEndpointConfig
      Parameters:
      idleTimeout - the read idle timeout
      Returns:
      a reference to this, so the API can be used fluently
    • setWriteIdleTimeout

      public TcpServerConfig setWriteIdleTimeout(Duration idleTimeout)
      Description copied from class: EndpointConfig

      Set the stream write idle timeout, zero or null means don't time out. This determines if a stream will timeout and be closed if no data is sent within the timeout.

      Overrides:
      setWriteIdleTimeout in class TcpEndpointConfig
      Parameters:
      idleTimeout - the write idle timeout
      Returns:
      a reference to this, so the API can be used fluently
    • setLogConfig

      public TcpServerConfig setLogConfig(LogConfig config)
      Description copied from class: EndpointConfig
      Configure the log config: Netty's stream pipeline is configured for logging on Netty's logger.
      Overrides:
      setLogConfig in class TcpEndpointConfig
      Parameters:
      config - the log config
      Returns:
      a reference to this, so the API can be used fluently
    • setSsl

      public TcpServerConfig setSsl(boolean ssl)
      Description copied from class: TcpEndpointConfig
      Set whether SSL/TLS is enabled
      Overrides:
      setSsl in class TcpEndpointConfig
      Parameters:
      ssl - true if enabled
      Returns:
      a reference to this, so the API can be used fluently
    • getPort

      public int getPort()
      Returns:
      the port
    • setPort

      public TcpServerConfig setPort(int port)
      Set the port
      Parameters:
      port - the port
      Returns:
      a reference to this, so the API can be used fluently
    • getHost

      public String getHost()
      Returns:
      the host
    • setHost

      public TcpServerConfig setHost(String host)
      Set the host
      Parameters:
      host - the host
      Returns:
      a reference to this, so the API can be used fluently
    • getAcceptBacklog

      public int getAcceptBacklog()
      Returns:
      the value of accept backlog
    • setAcceptBacklog

      public TcpServerConfig setAcceptBacklog(int acceptBacklog)
      Set the accept back log
      Parameters:
      acceptBacklog - accept backlog
      Returns:
      a reference to this, so the API can be used fluently
    • isUseProxyProtocol

      public boolean isUseProxyProtocol()
      Returns:
      whether the server uses the HA Proxy protocol
    • setUseProxyProtocol

      public TcpServerConfig setUseProxyProtocol(boolean useProxyProtocol)
      Set whether the server uses the HA Proxy protocol
      Returns:
      a reference to this, so the API can be used fluently
    • getProxyProtocolTimeout

      public Duration getProxyProtocolTimeout()
      Returns:
      the Proxy protocol timeout.
    • setProxyProtocolTimeout

      public TcpServerConfig setProxyProtocolTimeout(Duration proxyProtocolTimeout)
      Set the Proxy protocol timeout, default time unit.
      Parameters:
      proxyProtocolTimeout - the Proxy protocol timeout to set
      Returns:
      a reference to this, so the API can be used fluently
    • getTrafficShapingOptions

      public TrafficShapingOptions getTrafficShapingOptions()
      Returns:
      traffic shaping options used by Net server.
    • setTrafficShapingOptions

      public TcpServerConfig setTrafficShapingOptions(TrafficShapingOptions trafficShapingOptions)
      Set traffic shaping options. If not specified, traffic is unthrottled.
      Parameters:
      trafficShapingOptions - options used by traffic handler
      Returns:
      a reference to this, so the API can be used fluently