Top Description Methods
io.netty.channel.socket

public Interface ServerSocketChannelConfig

extends ChannelConfig
Known Direct Subinterfaces
io.netty.channel.socket.oio.OioServerSocketChannelConfig
Known Direct Implementers
io.netty.channel.socket.DefaultServerSocketChannelConfig
Imports
io.netty.buffer.ByteBufAllocator, io.netty.channel.ChannelConfig, .MessageSizeEstimator, .RecvByteBufAllocator, .WriteBufferWaterMark, java.net.ServerSocket, .StandardSocketOptions

A ChannelConfig for a ServerSocketChannel.

Available options

In addition to the options provided by ChannelConfig, ServerSocketChannelConfig allows the following options in the option map:
NameAssociated setter method
"backlog"setBacklog(int)
"reuseAddress"setReuseAddress(boolean)
"receiveBufferSize"setReceiveBufferSize(int)

Method Summary

Modifier and TypeMethod and Description
public int
getBacklog()

Gets the backlog value to specify when the channel binds to a local address.

public int
public boolean
public ServerSocketChannelConfig
setAllocator(ByteBufAllocator allocator)

Redeclares io.netty.channel.ChannelConfig.setAllocator.

Set the ByteBufAllocator which is used for the channel to allocate buffers.
public ServerSocketChannelConfig
setAutoRead(boolean autoRead)

Redeclares io.netty.channel.ChannelConfig.setAutoRead.

Sets if ChannelHandlerContext#read() will be invoked automatically so that a user application doesn't need to call it at all.
public ServerSocketChannelConfig
setBacklog(int backlog)

Sets the backlog value to specify when the channel binds to a local address.

public ServerSocketChannelConfig
setConnectTimeoutMillis(int
the connect timeout in milliseconds. 0 to disable.
connectTimeoutMillis
)

Redeclares io.netty.channel.ChannelConfig.setConnectTimeoutMillis.

Sets the connect timeout of the channel in milliseconds.
public ServerSocketChannelConfig
public ServerSocketChannelConfig
setMessageSizeEstimator(MessageSizeEstimator estimator)

Redeclares io.netty.channel.ChannelConfig.setMessageSizeEstimator.

Set the MessageSizeEstimator which is used for the channel to detect the size of a message.
public ServerSocketChannelConfig
setPerformancePreferences(int connectionTime, int latency, int bandwidth)

Sets the performance preferences as specified in ServerSocket#setPerformancePreferences(int, int, int).

public ServerSocketChannelConfig
setReceiveBufferSize(int receiveBufferSize)

Gets the StandardSocketOptions#SO_SNDBUF option.

public ServerSocketChannelConfig
setRecvByteBufAllocator(RecvByteBufAllocator allocator)

Redeclares io.netty.channel.ChannelConfig.setRecvByteBufAllocator.

Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.
public ServerSocketChannelConfig
setReuseAddress(boolean reuseAddress)

Sets the StandardSocketOptions#SO_REUSEADDR option.

public ServerSocketChannelConfig
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)

Redeclares io.netty.channel.ChannelConfig.setWriteBufferHighWaterMark.

Sets the high water mark of the write buffer.

public ServerSocketChannelConfig
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)

Redeclares io.netty.channel.ChannelConfig.setWriteBufferLowWaterMark.

Sets the low water mark of the write buffer.

public ServerSocketChannelConfig
setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)

Redeclares io.netty.channel.ChannelConfig.setWriteBufferWaterMark.

Set the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.
public ServerSocketChannelConfig
setWriteSpinCount(int writeSpinCount)

Redeclares io.netty.channel.ChannelConfig.setWriteSpinCount.

Sets the maximum loop count for a write operation until WritableByteChannel#write(ByteBuffer) returns a non-zero value.
Inherited from io.netty.channel.ChannelConfig:
getAllocatorgetConnectTimeoutMillisgetMaxMessagesPerReadgetMessageSizeEstimatorgetOptiongetOptionsgetRecvByteBufAllocatorgetWriteBufferHighWaterMarkgetWriteBufferLowWaterMarkgetWriteBufferWaterMarkgetWriteSpinCountisAutoCloseisAutoReadsetAutoClosesetOptionsetOptions

Method Detail

getBacklogback to summary
public int getBacklog()

Gets the backlog value to specify when the channel binds to a local address.

getReceiveBufferSizeback to summary
public int getReceiveBufferSize()

Gets the StandardSocketOptions#SO_RCVBUF option.

isReuseAddressback to summary
public boolean isReuseAddress()

Gets the StandardSocketOptions#SO_REUSEADDR option.

setAllocatorback to summary
public ServerSocketChannelConfig setAllocator(ByteBufAllocator allocator)

Redeclares io.netty.channel.ChannelConfig.setAllocator.

Doc from io.netty.channel.ChannelConfig.setAllocator.

Set the ByteBufAllocator which is used for the channel to allocate buffers.

Annotations
@Override
setAutoReadback to summary
public ServerSocketChannelConfig setAutoRead(boolean autoRead)

Redeclares io.netty.channel.ChannelConfig.setAutoRead.

Doc from io.netty.channel.ChannelConfig.setAutoRead.

Sets if ChannelHandlerContext#read() will be invoked automatically so that a user application doesn't need to call it at all. The default value is true.

Annotations
@Override
setBacklogback to summary
public ServerSocketChannelConfig setBacklog(int backlog)

Sets the backlog value to specify when the channel binds to a local address.

setConnectTimeoutMillisback to summary
public ServerSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)

Redeclares io.netty.channel.ChannelConfig.setConnectTimeoutMillis.

Doc from io.netty.channel.ChannelConfig.setConnectTimeoutMillis.

Sets the connect timeout of the channel in milliseconds. If the Channel does not support connect operation, this property is not used at all, and therefore will be ignored.

Parameters
connectTimeoutMillis:int

the connect timeout in milliseconds. 0 to disable.

Annotations
@Override
setMaxMessagesPerReadback to summary
public ServerSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)

Redeclares io.netty.channel.ChannelConfig.setMaxMessagesPerRead.

Deprecated

Annotations
@Override
@Deprecated
setMessageSizeEstimatorback to summary
public ServerSocketChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)

Redeclares io.netty.channel.ChannelConfig.setMessageSizeEstimator.

Doc from io.netty.channel.ChannelConfig.setMessageSizeEstimator.

Set the MessageSizeEstimator which is used for the channel to detect the size of a message.

Annotations
@Override
setPerformancePreferencesback to summary
public ServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth)

Sets the performance preferences as specified in ServerSocket#setPerformancePreferences(int, int, int).

setReceiveBufferSizeback to summary
public ServerSocketChannelConfig setReceiveBufferSize(int receiveBufferSize)

Gets the StandardSocketOptions#SO_SNDBUF option.

setRecvByteBufAllocatorback to summary
public ServerSocketChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)

Redeclares io.netty.channel.ChannelConfig.setRecvByteBufAllocator.

Doc from io.netty.channel.ChannelConfig.setRecvByteBufAllocator.

Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.

Annotations
@Override
setReuseAddressback to summary
public ServerSocketChannelConfig setReuseAddress(boolean reuseAddress)

Sets the StandardSocketOptions#SO_REUSEADDR option.

setWriteBufferHighWaterMarkback to summary
public ServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)

Redeclares io.netty.channel.ChannelConfig.setWriteBufferHighWaterMark.

Doc from io.netty.channel.ChannelConfig.setWriteBufferHighWaterMark.

Sets the high water mark of the write buffer. If the number of bytes queued in the write buffer exceeds this value, Channel#isWritable() will start to return false.

Annotations
@Override
setWriteBufferLowWaterMarkback to summary
public ServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)

Redeclares io.netty.channel.ChannelConfig.setWriteBufferLowWaterMark.

Doc from io.netty.channel.ChannelConfig.setWriteBufferLowWaterMark.

Sets the low water mark of the write buffer. Once the number of bytes queued in the write buffer exceeded the high water mark and then dropped down below this value, Channel#isWritable() will start to return true again.

Annotations
@Override
setWriteBufferWaterMarkback to summary
public ServerSocketChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)

Redeclares io.netty.channel.ChannelConfig.setWriteBufferWaterMark.

Doc from io.netty.channel.ChannelConfig.setWriteBufferWaterMark.

Set the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.

Annotations
@Override
setWriteSpinCountback to summary
public ServerSocketChannelConfig setWriteSpinCount(int writeSpinCount)

Redeclares io.netty.channel.ChannelConfig.setWriteSpinCount.

Doc from io.netty.channel.ChannelConfig.setWriteSpinCount.

Sets the maximum loop count for a write operation until WritableByteChannel#write(ByteBuffer) returns a non-zero value. It is similar to what a spin lock is used for in concurrency programming. It improves memory utilization and write throughput depending on the platform that JVM runs on. The default value is 16.

Annotations
@Override