Class TcpServerConfig
- java.lang.Object
-
- io.servicetalk.tcp.netty.internal.TcpServerConfig
-
public final class TcpServerConfig extends java.lang.ObjectConfiguration for TCP based servers.
-
-
Constructor Summary
Constructors Constructor Description TcpServerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReadOnlyTcpServerConfigasReadOnly(java.util.List<java.lang.String> supportedAlpnProtocols)Returns an immutable view of this config, any changes to this config will not alter the returned view.TcpServerConfigbacklog(int backlog)The maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter.voidenableWireLogging(java.lang.String loggerName)Enable wire-logging for all connections.voidenableWireLogging(java.lang.String loggerName, LogLevel logLevel, java.util.function.BooleanSupplier logUserData)Enable wire-logging for all connections.voidflushStrategy(FlushStrategy flushStrategy)SetsFlushStrategyto use for all connections.TcpServerConfigsecure(ReadOnlyServerSecurityConfig securityConfig, java.lang.String... sniHostnames)Add security related config.voidsecure(SecurityConfig securityConfig)Add security related config.<T> voidsocketOption(java.net.SocketOption<T> option, T value)Add aSocketOptionthat is applied.voidtransportObserver(TransportObserver transportObserver)Sets aTransportObserverthat provides visibility into transport events.
-
-
-
Method Detail
-
transportObserver
public void transportObserver(TransportObserver transportObserver)
Sets aTransportObserverthat provides visibility into transport events.- Parameters:
transportObserver- ATransportObserverthat provides visibility into transport events.
-
secure
public TcpServerConfig secure(ReadOnlyServerSecurityConfig securityConfig, java.lang.String... sniHostnames)
Add security related config.- Parameters:
securityConfig- theReadOnlyServerSecurityConfigfor the passed hostnamessniHostnames- SNI hostnames for which this config is defined- Returns:
this
-
backlog
public TcpServerConfig backlog(int backlog)
The maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter. If a connection indication arrives when the queue is full, the connection may time out.- Parameters:
backlog- the backlog to use when accepting connections- Returns:
this
-
asReadOnly
public ReadOnlyTcpServerConfig asReadOnly(java.util.List<java.lang.String> supportedAlpnProtocols)
Returns an immutable view of this config, any changes to this config will not alter the returned view.- Parameters:
supportedAlpnProtocols- a list of supported protocols for ALPN configuration- Returns:
- an immutable view of this config
-
socketOption
public final <T> void socketOption(java.net.SocketOption<T> option, T value)Add aSocketOptionthat is applied.- Type Parameters:
T- the type of the value- Parameters:
option- the option to applyvalue- the value- Throws:
java.lang.IllegalArgumentException- if theSocketOptionis not supported- See Also:
StandardSocketOptions,ServiceTalkSocketOptions
-
flushStrategy
public final void flushStrategy(FlushStrategy flushStrategy)
SetsFlushStrategyto use for all connections.- Parameters:
flushStrategy-FlushStrategyto use for all connections
-
enableWireLogging
public final void enableWireLogging(java.lang.String loggerName)
Enable wire-logging for all connections. All wire events will be logged at trace level.- Parameters:
loggerName- The name of the logger to log wire events
-
enableWireLogging
public final void enableWireLogging(java.lang.String loggerName, LogLevel logLevel, java.util.function.BooleanSupplier logUserData)Enable wire-logging for all connections. All wire events will be logged at trace level.- Parameters:
loggerName- provides the logger to log data/events to/from the wire.logLevel- the level to log data/events to/from the wire.logUserData-trueto include user data (e.g. data, headers, etc.).falseto exclude user data and log only network events.
-
secure
public final void secure(SecurityConfig securityConfig)
Add security related config.- Parameters:
securityConfig- theReadOnlyServerSecurityConfigto use
-
-