Package io.netty.incubator.channel.uring
Class IOUringServerSocketChannelConfig
- java.lang.Object
-
- io.netty.channel.DefaultChannelConfig
-
- io.netty.incubator.channel.uring.IOUringServerSocketChannelConfig
-
- All Implemented Interfaces:
io.netty.channel.ChannelConfig,io.netty.channel.socket.ServerSocketChannelConfig
public final class IOUringServerSocketChannelConfig extends io.netty.channel.DefaultChannelConfig implements io.netty.channel.socket.ServerSocketChannelConfig
-
-
Field Summary
Fields Modifier and Type Field Description private intbacklogprivate intpendingFastOpenRequestsThreshold
-
Constructor Summary
Constructors Constructor Description IOUringServerSocketChannelConfig(AbstractIOUringServerChannel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetBacklog()<T> TgetOption(io.netty.channel.ChannelOption<T> option)java.util.Map<io.netty.channel.ChannelOption<?>,java.lang.Object>getOptions()intgetReceiveBufferSize()intgetTcpDeferAccept()Returns a positive value if TCP_DEFER_ACCEPT is enabled.intgetTcpFastopen()Returns threshold value of number of pending for fast open connect.booleanisFreeBind()booleanisIpTransparent()booleanisReuseAddress()booleanisReusePort()Returnstrueif the SO_REUSEPORT option is set.IOUringServerSocketChannelConfigsetAllocator(io.netty.buffer.ByteBufAllocator allocator)IOUringServerSocketChannelConfigsetAutoRead(boolean autoRead)IOUringServerSocketChannelConfigsetBacklog(int backlog)IOUringServerSocketChannelConfigsetConnectTimeoutMillis(int connectTimeoutMillis)IOUringServerSocketChannelConfigsetFreeBind(boolean freeBind)IOUringServerSocketChannelConfigsetIpTransparent(boolean transparent)IOUringServerSocketChannelConfigsetMaxMessagesPerRead(int maxMessagesPerRead)Deprecated.IOUringServerSocketChannelConfigsetMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)<T> booleansetOption(io.netty.channel.ChannelOption<T> option, T value)IOUringServerSocketChannelConfigsetPerformancePreferences(int connectionTime, int latency, int bandwidth)IOUringServerSocketChannelConfigsetReceiveBufferSize(int receiveBufferSize)IOUringServerSocketChannelConfigsetRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)IOUringServerSocketChannelConfigsetReuseAddress(boolean reuseAddress)IOUringServerSocketChannelConfigsetReusePort(boolean reusePort)Set the SO_REUSEPORT option on the underlying Channel.IOUringServerSocketChannelConfigsetTcpDeferAccept(int deferAccept)Set theTCP_DEFER_ACCEPToption on the socket.IOUringServerSocketChannelConfigsetTcpFastopen(int pendingFastOpenRequestsThreshold)Enables tcpFastOpen on the server channel.IOUringServerSocketChannelConfigsetWriteBufferHighWaterMark(int writeBufferHighWaterMark)Deprecated.IOUringServerSocketChannelConfigsetWriteBufferLowWaterMark(int writeBufferLowWaterMark)Deprecated.IOUringServerSocketChannelConfigsetWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)IOUringServerSocketChannelConfigsetWriteSpinCount(int writeSpinCount)-
Methods inherited from class io.netty.channel.DefaultChannelConfig
autoReadCleared, getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setAutoClose, setMaxMessagesPerWrite, setOptions, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.ChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setAutoClose, setOptions
-
-
-
-
Constructor Detail
-
IOUringServerSocketChannelConfig
IOUringServerSocketChannelConfig(AbstractIOUringServerChannel channel)
-
-
Method Detail
-
getOptions
public java.util.Map<io.netty.channel.ChannelOption<?>,java.lang.Object> getOptions()
- Specified by:
getOptionsin interfaceio.netty.channel.ChannelConfig- Overrides:
getOptionsin classio.netty.channel.DefaultChannelConfig
-
getOption
public <T> T getOption(io.netty.channel.ChannelOption<T> option)
- Specified by:
getOptionin interfaceio.netty.channel.ChannelConfig- Overrides:
getOptionin classio.netty.channel.DefaultChannelConfig
-
setOption
public <T> boolean setOption(io.netty.channel.ChannelOption<T> option, T value)- Specified by:
setOptionin interfaceio.netty.channel.ChannelConfig- Overrides:
setOptionin classio.netty.channel.DefaultChannelConfig
-
setPerformancePreferences
public IOUringServerSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth)
- Specified by:
setPerformancePreferencesin interfaceio.netty.channel.socket.ServerSocketChannelConfig
-
isReuseAddress
public boolean isReuseAddress()
- Specified by:
isReuseAddressin interfaceio.netty.channel.socket.ServerSocketChannelConfig
-
setReuseAddress
public IOUringServerSocketChannelConfig setReuseAddress(boolean reuseAddress)
- Specified by:
setReuseAddressin interfaceio.netty.channel.socket.ServerSocketChannelConfig
-
getReceiveBufferSize
public int getReceiveBufferSize()
- Specified by:
getReceiveBufferSizein interfaceio.netty.channel.socket.ServerSocketChannelConfig
-
setReceiveBufferSize
public IOUringServerSocketChannelConfig setReceiveBufferSize(int receiveBufferSize)
- Specified by:
setReceiveBufferSizein interfaceio.netty.channel.socket.ServerSocketChannelConfig
-
getBacklog
public int getBacklog()
- Specified by:
getBacklogin interfaceio.netty.channel.socket.ServerSocketChannelConfig
-
setBacklog
public IOUringServerSocketChannelConfig setBacklog(int backlog)
- Specified by:
setBacklogin interfaceio.netty.channel.socket.ServerSocketChannelConfig
-
setConnectTimeoutMillis
public IOUringServerSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
- Specified by:
setConnectTimeoutMillisin interfaceio.netty.channel.ChannelConfig- Specified by:
setConnectTimeoutMillisin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setConnectTimeoutMillisin classio.netty.channel.DefaultChannelConfig
-
setMaxMessagesPerRead
@Deprecated public IOUringServerSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.- Specified by:
setMaxMessagesPerReadin interfaceio.netty.channel.ChannelConfig- Specified by:
setMaxMessagesPerReadin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setMaxMessagesPerReadin classio.netty.channel.DefaultChannelConfig
-
setWriteSpinCount
public IOUringServerSocketChannelConfig setWriteSpinCount(int writeSpinCount)
- Specified by:
setWriteSpinCountin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteSpinCountin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setWriteSpinCountin classio.netty.channel.DefaultChannelConfig
-
setAllocator
public IOUringServerSocketChannelConfig setAllocator(io.netty.buffer.ByteBufAllocator allocator)
- Specified by:
setAllocatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setAllocatorin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setAllocatorin classio.netty.channel.DefaultChannelConfig
-
setRecvByteBufAllocator
public IOUringServerSocketChannelConfig setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)
- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setRecvByteBufAllocatorin classio.netty.channel.DefaultChannelConfig
-
setAutoRead
public IOUringServerSocketChannelConfig setAutoRead(boolean autoRead)
- Specified by:
setAutoReadin interfaceio.netty.channel.ChannelConfig- Specified by:
setAutoReadin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setAutoReadin classio.netty.channel.DefaultChannelConfig
-
setWriteBufferHighWaterMark
@Deprecated public IOUringServerSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.- Specified by:
setWriteBufferHighWaterMarkin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteBufferHighWaterMarkin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setWriteBufferHighWaterMarkin classio.netty.channel.DefaultChannelConfig
-
setWriteBufferLowWaterMark
@Deprecated public IOUringServerSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.- Specified by:
setWriteBufferLowWaterMarkin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteBufferLowWaterMarkin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setWriteBufferLowWaterMarkin classio.netty.channel.DefaultChannelConfig
-
setWriteBufferWaterMark
public IOUringServerSocketChannelConfig setWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)
- Specified by:
setWriteBufferWaterMarkin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteBufferWaterMarkin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setWriteBufferWaterMarkin classio.netty.channel.DefaultChannelConfig
-
setMessageSizeEstimator
public IOUringServerSocketChannelConfig setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)
- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.socket.ServerSocketChannelConfig- Overrides:
setMessageSizeEstimatorin classio.netty.channel.DefaultChannelConfig
-
isReusePort
public boolean isReusePort()
Returnstrueif the SO_REUSEPORT option is set.
-
setReusePort
public IOUringServerSocketChannelConfig setReusePort(boolean reusePort)
Set the SO_REUSEPORT option on the underlying Channel. This will allow to bind multipleServerSocketChannels to the same port and so accept connections with multiple threads. Be aware this method needs be called beforeChannelOutboundInvoker.bind(java.net.SocketAddress)to have any affect.
-
isFreeBind
public boolean isFreeBind()
-
setFreeBind
public IOUringServerSocketChannelConfig setFreeBind(boolean freeBind)
-
isIpTransparent
public boolean isIpTransparent()
-
setIpTransparent
public IOUringServerSocketChannelConfig setIpTransparent(boolean transparent)
-
setTcpDeferAccept
public IOUringServerSocketChannelConfig setTcpDeferAccept(int deferAccept)
Set theTCP_DEFER_ACCEPToption on the socket. Seeman 7 tcpfor more details.
-
getTcpDeferAccept
public int getTcpDeferAccept()
Returns a positive value if TCP_DEFER_ACCEPT is enabled.
-
getTcpFastopen
public int getTcpFastopen()
Returns threshold value of number of pending for fast open connect.- See Also:
- RFC 7413 Passive Open
-
setTcpFastopen
public IOUringServerSocketChannelConfig setTcpFastopen(int pendingFastOpenRequestsThreshold)
Enables tcpFastOpen on the server channel. If the underlying os doesn't support TCP_FASTOPEN setting this has no effect. This has to be set before doing listen on the socket otherwise this takes no effect.- Parameters:
pendingFastOpenRequestsThreshold- number of requests to be pending for fastopen at a given point in time for security.- See Also:
- RFC 7413 Passive Open
-
-