Package io.netty.channel.socket
Interface DuplexChannelConfig
-
- All Superinterfaces:
ChannelConfig
- All Known Subinterfaces:
OioSocketChannelConfig
,SocketChannelConfig
- All Known Implementing Classes:
DefaultOioSocketChannelConfig
,DefaultSocketChannelConfig
,EpollDomainSocketChannelConfig
,EpollSocketChannelConfig
,KQueueDomainSocketChannelConfig
,KQueueSocketChannelConfig
public interface DuplexChannelConfig extends ChannelConfig
AChannelConfig
for aDuplexChannel
.Available options
In addition to the options provided byChannelConfig
,DuplexChannelConfig
allows the following options in the option map:ChannelOption.ALLOW_HALF_CLOSURE
setAllowHalfClosure(boolean)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
isAllowHalfClosure()
Returnstrue
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 theByteBufAllocator
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 theChannel
should be closed automatically and immediately on write failure.DuplexChannelConfig
setAutoRead(boolean autoRead)
Sets ifChannelHandlerContext.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 theMessageSizeEstimator
which is used for the channel to detect the size of a message.DuplexChannelConfig
setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Set theRecvByteBufAllocator
which is used for the channel to allocate receive buffers.DuplexChannelConfig
setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Set theWriteBufferWaterMark
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 untilWritableByteChannel.write(ByteBuffer)
returns a non-zero value.-
Methods inherited from interface io.netty.channel.ChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getOption, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setConnectTimeoutMillis, setOption, setOptions, setWriteBufferHighWaterMark, setWriteBufferLowWaterMark
-
-
-
-
Method Detail
-
isAllowHalfClosure
boolean isAllowHalfClosure()
Returnstrue
if and only if the channel should not close itself when its remote peer shuts down output to make the connection half-closed. Iffalse
, the connection is closed automatically when the remote peer shuts down output.
-
setAllowHalfClosure
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. Iftrue
the connection is not closed when the remote peer shuts down output. Instead,ChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object)
is invoked with aChannelInputShutdownEvent
object. Iffalse
, the connection is closed automatically.
-
setMaxMessagesPerRead
@Deprecated DuplexChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.- Specified by:
setMaxMessagesPerRead
in interfaceChannelConfig
-
setWriteSpinCount
DuplexChannelConfig setWriteSpinCount(int writeSpinCount)
Description copied from interface:ChannelConfig
Sets the maximum loop count for a write operation untilWritableByteChannel.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 is16
.- Specified by:
setWriteSpinCount
in interfaceChannelConfig
-
setAllocator
DuplexChannelConfig setAllocator(ByteBufAllocator allocator)
Description copied from interface:ChannelConfig
Set theByteBufAllocator
which is used for the channel to allocate buffers.- Specified by:
setAllocator
in interfaceChannelConfig
-
setRecvByteBufAllocator
DuplexChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Description copied from interface:ChannelConfig
Set theRecvByteBufAllocator
which is used for the channel to allocate receive buffers.- Specified by:
setRecvByteBufAllocator
in interfaceChannelConfig
-
setAutoRead
DuplexChannelConfig setAutoRead(boolean autoRead)
Description copied from interface:ChannelConfig
Sets ifChannelHandlerContext.read()
will be invoked automatically so that a user application doesn't need to call it at all. The default value istrue
.- Specified by:
setAutoRead
in interfaceChannelConfig
-
setAutoClose
DuplexChannelConfig setAutoClose(boolean autoClose)
Description copied from interface:ChannelConfig
Sets whether theChannel
should be closed automatically and immediately on write failure. The default istrue
.- Specified by:
setAutoClose
in interfaceChannelConfig
-
setMessageSizeEstimator
DuplexChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
Description copied from interface:ChannelConfig
Set theMessageSizeEstimator
which is used for the channel to detect the size of a message.- Specified by:
setMessageSizeEstimator
in interfaceChannelConfig
-
setWriteBufferWaterMark
DuplexChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Description copied from interface:ChannelConfig
Set theWriteBufferWaterMark
which is used for setting the high and low water mark of the write buffer.- Specified by:
setWriteBufferWaterMark
in interfaceChannelConfig
-
-