public interface DuplexChannelConfig extends ChannelConfig
ChannelConfig for a DuplexChannel.
ChannelConfig,
DuplexChannelConfig allows the following options in the option map:
ChannelOption.ALLOW_HALF_CLOSURE | setAllowHalfClosure(boolean) |
| Modifier and Type | Method and Description |
|---|---|
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. |
DuplexChannelConfig |
setAllocator(ByteBufAllocator allocator)
Set the
ByteBufAllocator which is used for the channel
to allocate buffers. |
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.
|
DuplexChannelConfig |
setAutoClose(boolean autoClose)
Sets whether the
Channel should be closed automatically and immediately on write failure. |
DuplexChannelConfig |
setAutoRead(boolean autoRead)
Sets if
ChannelHandlerContext.read() will be invoked automatically so that a user application doesn't
need to call it at all. |
DuplexChannelConfig |
setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.
|
DuplexChannelConfig |
setMessageSizeEstimator(MessageSizeEstimator estimator)
Set the
MessageSizeEstimator which is used for the channel
to detect the size of a message. |
DuplexChannelConfig |
setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Set the
RecvByteBufAllocator which is used for the channel to allocate receive buffers. |
DuplexChannelConfig |
setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Set the
WriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer. |
DuplexChannelConfig |
setWriteSpinCount(int writeSpinCount)
Sets the maximum loop count for a write operation until
WritableByteChannel.write(ByteBuffer) returns a non-zero value. |
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getOption, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setConnectTimeoutMillis, setOption, setOptions, setWriteBufferHighWaterMark, setWriteBufferLowWaterMarkboolean isAllowHalfClosure()
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.DuplexChannelConfig setAllowHalfClosure(boolean allowHalfClosure)
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.@Deprecated DuplexChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
setMaxMessagesPerRead in interface ChannelConfigDuplexChannelConfig setWriteSpinCount(int writeSpinCount)
ChannelConfigWritableByteChannel.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.setWriteSpinCount in interface ChannelConfigDuplexChannelConfig setAllocator(ByteBufAllocator allocator)
ChannelConfigByteBufAllocator which is used for the channel
to allocate buffers.setAllocator in interface ChannelConfigDuplexChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
ChannelConfigRecvByteBufAllocator which is used for the channel to allocate receive buffers.setRecvByteBufAllocator in interface ChannelConfigDuplexChannelConfig setAutoRead(boolean autoRead)
ChannelConfigChannelHandlerContext.read() will be invoked automatically so that a user application doesn't
need to call it at all. The default value is true.setAutoRead in interface ChannelConfigDuplexChannelConfig setAutoClose(boolean autoClose)
ChannelConfigChannel should be closed automatically and immediately on write failure.
The default is true.setAutoClose in interface ChannelConfigDuplexChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
ChannelConfigMessageSizeEstimator which is used for the channel
to detect the size of a message.setMessageSizeEstimator in interface ChannelConfigDuplexChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
ChannelConfigWriteBufferWaterMark which is used for setting the high and low
water mark of the write buffer.setWriteBufferWaterMark in interface ChannelConfigCopyright © 2008–2025 The Netty Project. All rights reserved.