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) |
限定符和类型 | 方法和说明 |
---|---|
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)
已过时。
|
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, setWriteBufferLowWaterMark
boolean 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
在接口中 ChannelConfig
DuplexChannelConfig setWriteSpinCount(int writeSpinCount)
ChannelConfig
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
.setWriteSpinCount
在接口中 ChannelConfig
DuplexChannelConfig setAllocator(ByteBufAllocator allocator)
ChannelConfig
ByteBufAllocator
which is used for the channel
to allocate buffers.setAllocator
在接口中 ChannelConfig
DuplexChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
ChannelConfig
RecvByteBufAllocator
which is used for the channel to allocate receive buffers.setRecvByteBufAllocator
在接口中 ChannelConfig
DuplexChannelConfig setAutoRead(boolean autoRead)
ChannelConfig
ChannelHandlerContext.read()
will be invoked automatically so that a user application doesn't
need to call it at all. The default value is true
.setAutoRead
在接口中 ChannelConfig
DuplexChannelConfig setAutoClose(boolean autoClose)
ChannelConfig
Channel
should be closed automatically and immediately on write failure.
The default is true
.setAutoClose
在接口中 ChannelConfig
DuplexChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
ChannelConfig
MessageSizeEstimator
which is used for the channel
to detect the size of a message.setMessageSizeEstimator
在接口中 ChannelConfig
DuplexChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
ChannelConfig
WriteBufferWaterMark
which is used for setting the high and low
water mark of the write buffer.setWriteBufferWaterMark
在接口中 ChannelConfig