Top Description Methods
io.netty.channel.socket

public Interface DuplexChannelConfig

extends ChannelConfig
Known Direct Subinterfaces
io.netty.channel.socket.SocketChannelConfig
Imports
io.netty.buffer.ByteBufAllocator, io.netty.channel.ChannelConfig, .ChannelHandlerContext, .ChannelInboundHandler, .ChannelOption, .MessageSizeEstimator, .RecvByteBufAllocator, .WriteBufferWaterMark

A ChannelConfig for a DuplexChannel.

Available options

In addition to the options provided by ChannelConfig, DuplexChannelConfig allows the following options in the option map:
ChannelOption#ALLOW_HALF_CLOSUREsetAllowHalfClosure(boolean)

Method Summary

Modifier and TypeMethod and Description
public boolean
isAllowHalfClosure()

Returns true if and only if the channel should not close itself when its remote peer shuts down output to make the connection half-closed.

public DuplexChannelConfig
setAllocator(ByteBufAllocator allocator)

Redeclares io.netty.channel.ChannelConfig.setAllocator.

Set the ByteBufAllocator which is used for the channel to allocate buffers.
public DuplexChannelConfig
setAllowHalfClosure(boolean allowHalfClosure)

Sets whether the channel should not close itself when its remote peer shuts down output to make the connection half-closed.

public DuplexChannelConfig
setAutoClose(boolean autoClose)

Redeclares io.netty.channel.ChannelConfig.setAutoClose.

Sets whether the Channel should be closed automatically and immediately on write failure.
public DuplexChannelConfig
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 DuplexChannelConfig
public DuplexChannelConfig
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 DuplexChannelConfig
setRecvByteBufAllocator(RecvByteBufAllocator allocator)

Redeclares io.netty.channel.ChannelConfig.setRecvByteBufAllocator.

Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.
public DuplexChannelConfig
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 DuplexChannelConfig
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:
getAllocatorgetConnectTimeoutMillisgetMaxMessagesPerReadgetMessageSizeEstimatorgetOptiongetOptionsgetRecvByteBufAllocatorgetWriteBufferHighWaterMarkgetWriteBufferLowWaterMarkgetWriteBufferWaterMarkgetWriteSpinCountisAutoCloseisAutoReadsetConnectTimeoutMillissetOptionsetOptionssetWriteBufferHighWaterMarksetWriteBufferLowWaterMark

Method Detail

isAllowHalfClosureback to summary
public boolean isAllowHalfClosure()

Returns true if and only if the channel should not close itself when its remote peer shuts down output to make the connection half-closed. If false, the connection is closed automatically when the remote peer shuts down output.

setAllocatorback to summary
public DuplexChannelConfig 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
setAllowHalfClosureback to summary
public DuplexChannelConfig setAllowHalfClosure(boolean allowHalfClosure)

Sets whether the channel should not close itself when its remote peer shuts down output to make the connection half-closed. If true the connection is not closed when the remote peer shuts down output. Instead, ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object) is invoked with a ChannelInputShutdownEvent object. If false, the connection is closed automatically.

setAutoCloseback to summary
public DuplexChannelConfig setAutoClose(boolean autoClose)

Redeclares io.netty.channel.ChannelConfig.setAutoClose.

Doc from io.netty.channel.ChannelConfig.setAutoClose.

Sets whether the Channel should be closed automatically and immediately on write failure. The default is true.

Annotations
@Override
setAutoReadback to summary
public DuplexChannelConfig 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
setMaxMessagesPerReadback to summary
public DuplexChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)

Redeclares io.netty.channel.ChannelConfig.setMaxMessagesPerRead.

Deprecated

Annotations
@Override
@Deprecated
setMessageSizeEstimatorback to summary
public DuplexChannelConfig 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
setRecvByteBufAllocatorback to summary
public DuplexChannelConfig 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
setWriteBufferWaterMarkback to summary
public DuplexChannelConfig 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 DuplexChannelConfig 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