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, 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
in interface 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
in interface ChannelConfig
DuplexChannelConfig setAllocator(ByteBufAllocator allocator)
ChannelConfig
ByteBufAllocator
which is used for the channel
to allocate buffers.setAllocator
in interface ChannelConfig
DuplexChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
ChannelConfig
RecvByteBufAllocator
which is used for the channel to allocate receive buffers.setRecvByteBufAllocator
in interface 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
in interface ChannelConfig
DuplexChannelConfig setAutoClose(boolean autoClose)
ChannelConfig
Channel
should be closed automatically and immediately on write failure.
The default is true
.setAutoClose
in interface ChannelConfig
DuplexChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
ChannelConfig
MessageSizeEstimator
which is used for the channel
to detect the size of a message.setMessageSizeEstimator
in interface ChannelConfig
DuplexChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
ChannelConfig
WriteBufferWaterMark
which is used for setting the high and low
water mark of the write buffer.setWriteBufferWaterMark
in interface ChannelConfig
Copyright © 2008–2024 The Netty Project. All rights reserved.