Package io.netty.channel.socket
Interface DuplexChannelConfig
-
- All Superinterfaces:
ChannelConfig
- All Known Subinterfaces:
OioSocketChannelConfig,QuicStreamChannelConfig,SocketChannelConfig
- All Known Implementing Classes:
DefaultOioSocketChannelConfig,DefaultSocketChannelConfig,EpollDomainSocketChannelConfig,EpollSocketChannelConfig,KQueueDomainSocketChannelConfig,KQueueSocketChannelConfig
public interface DuplexChannelConfig extends ChannelConfig
AChannelConfigfor aDuplexChannel.Available options
In addition to the options provided byChannelConfig,DuplexChannelConfigallows the following options in the option map:ChannelOption.ALLOW_HALF_CLOSUREsetAllowHalfClosure(boolean)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanisAllowHalfClosure()Returnstrueif and only if the channel should not close itself when its remote peer shuts down output to make the connection half-closed.DuplexChannelConfigsetAllocator(ByteBufAllocator allocator)Set theByteBufAllocatorwhich is used for the channel to allocate buffers.DuplexChannelConfigsetAllowHalfClosure(boolean allowHalfClosure)Sets whether the channel should not close itself when its remote peer shuts down output to make the connection half-closed.DuplexChannelConfigsetAutoClose(boolean autoClose)Sets whether theChannelshould be closed automatically and immediately on write failure.DuplexChannelConfigsetAutoRead(boolean autoRead)Sets ifChannelHandlerContext.read()will be invoked automatically so that a user application doesn't need to call it at all.DuplexChannelConfigsetMaxMessagesPerRead(int maxMessagesPerRead)Deprecated.DuplexChannelConfigsetMessageSizeEstimator(MessageSizeEstimator estimator)Set theMessageSizeEstimatorwhich is used for the channel to detect the size of a message.DuplexChannelConfigsetRecvByteBufAllocator(RecvByteBufAllocator allocator)Set theRecvByteBufAllocatorwhich is used for the channel to allocate receive buffers.DuplexChannelConfigsetWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)Set theWriteBufferWaterMarkwhich is used for setting the high and low water mark of the write buffer.DuplexChannelConfigsetWriteSpinCount(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()
Returnstrueif 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. Iftruethe connection is not closed when the remote peer shuts down output. Instead,ChannelInboundHandler.userEventTriggered(ChannelHandlerContext, Object)is invoked with aChannelInputShutdownEventobject. Iffalse, the connection is closed automatically.
-
setMaxMessagesPerRead
@Deprecated DuplexChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.- Specified by:
setMaxMessagesPerReadin interfaceChannelConfig
-
setWriteSpinCount
DuplexChannelConfig setWriteSpinCount(int writeSpinCount)
Description copied from interface:ChannelConfigSets 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:
setWriteSpinCountin interfaceChannelConfig
-
setAllocator
DuplexChannelConfig setAllocator(ByteBufAllocator allocator)
Description copied from interface:ChannelConfigSet theByteBufAllocatorwhich is used for the channel to allocate buffers.- Specified by:
setAllocatorin interfaceChannelConfig
-
setRecvByteBufAllocator
DuplexChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)
Description copied from interface:ChannelConfigSet theRecvByteBufAllocatorwhich is used for the channel to allocate receive buffers.- Specified by:
setRecvByteBufAllocatorin interfaceChannelConfig
-
setAutoRead
DuplexChannelConfig setAutoRead(boolean autoRead)
Description copied from interface:ChannelConfigSets 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:
setAutoReadin interfaceChannelConfig
-
setAutoClose
DuplexChannelConfig setAutoClose(boolean autoClose)
Description copied from interface:ChannelConfigSets whether theChannelshould be closed automatically and immediately on write failure. The default istrue.- Specified by:
setAutoClosein interfaceChannelConfig
-
setMessageSizeEstimator
DuplexChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)
Description copied from interface:ChannelConfigSet theMessageSizeEstimatorwhich is used for the channel to detect the size of a message.- Specified by:
setMessageSizeEstimatorin interfaceChannelConfig
-
setWriteBufferWaterMark
DuplexChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)
Description copied from interface:ChannelConfigSet theWriteBufferWaterMarkwhich is used for setting the high and low water mark of the write buffer.- Specified by:
setWriteBufferWaterMarkin interfaceChannelConfig
-
-