Package io.netty.incubator.channel.uring
Class IOUringDatagramChannelConfig
- java.lang.Object
-
- io.netty.channel.DefaultChannelConfig
-
- io.netty.incubator.channel.uring.IOUringDatagramChannelConfig
-
- All Implemented Interfaces:
io.netty.channel.ChannelConfig
,io.netty.channel.socket.DatagramChannelConfig
public final class IOUringDatagramChannelConfig extends io.netty.channel.DefaultChannelConfig implements io.netty.channel.socket.DatagramChannelConfig
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
activeOnOpen
private static io.netty.channel.RecvByteBufAllocator
DEFAULT_RCVBUF_ALLOCATOR
private int
maxDatagramSize
-
Constructor Summary
Constructors Constructor Description IOUringDatagramChannelConfig(AbstractIOUringChannel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) boolean
getActiveOnOpen()
java.net.InetAddress
getInterface()
int
getMaxDatagramPayloadSize()
Get the maximumDatagramPacket
size.java.net.NetworkInterface
getNetworkInterface()
<T> T
getOption(io.netty.channel.ChannelOption<T> option)
java.util.Map<io.netty.channel.ChannelOption<?>,java.lang.Object>
getOptions()
int
getReceiveBufferSize()
int
getSendBufferSize()
int
getTimeToLive()
int
getTrafficClass()
boolean
isBroadcast()
boolean
isFreeBind()
boolean
isIpTransparent()
boolean
isLoopbackModeDisabled()
boolean
isReuseAddress()
boolean
isReusePort()
Returnstrue
if the SO_REUSEPORT option is set.private void
setActiveOnOpen(boolean activeOnOpen)
IOUringDatagramChannelConfig
setAllocator(io.netty.buffer.ByteBufAllocator allocator)
IOUringDatagramChannelConfig
setAutoClose(boolean autoClose)
IOUringDatagramChannelConfig
setAutoRead(boolean autoRead)
IOUringDatagramChannelConfig
setBroadcast(boolean broadcast)
IOUringDatagramChannelConfig
setConnectTimeoutMillis(int connectTimeoutMillis)
IOUringDatagramChannelConfig
setFreeBind(boolean freeBind)
IOUringDatagramChannelConfig
setInterface(java.net.InetAddress interfaceAddress)
IOUringDatagramChannelConfig
setIpTransparent(boolean ipTransparent)
IOUringDatagramChannelConfig
setLoopbackModeDisabled(boolean loopbackModeDisabled)
IOUringDatagramChannelConfig
setMaxDatagramPayloadSize(int maxDatagramSize)
Set the maximumDatagramPacket
size.IOUringDatagramChannelConfig
setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.IOUringDatagramChannelConfig
setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)
IOUringDatagramChannelConfig
setNetworkInterface(java.net.NetworkInterface networkInterface)
<T> boolean
setOption(io.netty.channel.ChannelOption<T> option, T value)
IOUringDatagramChannelConfig
setReceiveBufferSize(int receiveBufferSize)
IOUringDatagramChannelConfig
setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)
IOUringDatagramChannelConfig
setReuseAddress(boolean reuseAddress)
IOUringDatagramChannelConfig
setReusePort(boolean reusePort)
Set the SO_REUSEPORT option on the underlying Channel.IOUringDatagramChannelConfig
setSendBufferSize(int sendBufferSize)
IOUringDatagramChannelConfig
setTimeToLive(int ttl)
IOUringDatagramChannelConfig
setTrafficClass(int trafficClass)
IOUringDatagramChannelConfig
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.IOUringDatagramChannelConfig
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.IOUringDatagramChannelConfig
setWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)
IOUringDatagramChannelConfig
setWriteSpinCount(int writeSpinCount)
-
Methods inherited from class io.netty.channel.DefaultChannelConfig
autoReadCleared, getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, 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, setOptions
-
-
-
-
Constructor Detail
-
IOUringDatagramChannelConfig
IOUringDatagramChannelConfig(AbstractIOUringChannel channel)
-
-
Method Detail
-
getOptions
public java.util.Map<io.netty.channel.ChannelOption<?>,java.lang.Object> getOptions()
- Specified by:
getOptions
in interfaceio.netty.channel.ChannelConfig
- Overrides:
getOptions
in classio.netty.channel.DefaultChannelConfig
-
getOption
public <T> T getOption(io.netty.channel.ChannelOption<T> option)
- Specified by:
getOption
in interfaceio.netty.channel.ChannelConfig
- Overrides:
getOption
in classio.netty.channel.DefaultChannelConfig
-
setOption
public <T> boolean setOption(io.netty.channel.ChannelOption<T> option, T value)
- Specified by:
setOption
in interfaceio.netty.channel.ChannelConfig
- Overrides:
setOption
in classio.netty.channel.DefaultChannelConfig
-
setActiveOnOpen
private void setActiveOnOpen(boolean activeOnOpen)
-
getActiveOnOpen
boolean getActiveOnOpen()
-
setMessageSizeEstimator
public IOUringDatagramChannelConfig setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)
- Specified by:
setMessageSizeEstimator
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setMessageSizeEstimator
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setMessageSizeEstimator
in classio.netty.channel.DefaultChannelConfig
-
setWriteBufferLowWaterMark
@Deprecated public IOUringDatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.- Specified by:
setWriteBufferLowWaterMark
in interfaceio.netty.channel.ChannelConfig
- Overrides:
setWriteBufferLowWaterMark
in classio.netty.channel.DefaultChannelConfig
-
setWriteBufferHighWaterMark
@Deprecated public IOUringDatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.- Specified by:
setWriteBufferHighWaterMark
in interfaceio.netty.channel.ChannelConfig
- Overrides:
setWriteBufferHighWaterMark
in classio.netty.channel.DefaultChannelConfig
-
setWriteBufferWaterMark
public IOUringDatagramChannelConfig setWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)
- Specified by:
setWriteBufferWaterMark
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setWriteBufferWaterMark
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setWriteBufferWaterMark
in classio.netty.channel.DefaultChannelConfig
-
setAutoClose
public IOUringDatagramChannelConfig setAutoClose(boolean autoClose)
- Specified by:
setAutoClose
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setAutoClose
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setAutoClose
in classio.netty.channel.DefaultChannelConfig
-
setAutoRead
public IOUringDatagramChannelConfig setAutoRead(boolean autoRead)
- Specified by:
setAutoRead
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setAutoRead
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setAutoRead
in classio.netty.channel.DefaultChannelConfig
-
setRecvByteBufAllocator
public IOUringDatagramChannelConfig setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)
- Specified by:
setRecvByteBufAllocator
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setRecvByteBufAllocator
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setRecvByteBufAllocator
in classio.netty.channel.DefaultChannelConfig
-
setWriteSpinCount
public IOUringDatagramChannelConfig setWriteSpinCount(int writeSpinCount)
- Specified by:
setWriteSpinCount
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setWriteSpinCount
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setWriteSpinCount
in classio.netty.channel.DefaultChannelConfig
-
setAllocator
public IOUringDatagramChannelConfig setAllocator(io.netty.buffer.ByteBufAllocator allocator)
- Specified by:
setAllocator
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setAllocator
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setAllocator
in classio.netty.channel.DefaultChannelConfig
-
setConnectTimeoutMillis
public IOUringDatagramChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
- Specified by:
setConnectTimeoutMillis
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setConnectTimeoutMillis
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setConnectTimeoutMillis
in classio.netty.channel.DefaultChannelConfig
-
setMaxMessagesPerRead
@Deprecated public IOUringDatagramChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.- Specified by:
setMaxMessagesPerRead
in interfaceio.netty.channel.ChannelConfig
- Specified by:
setMaxMessagesPerRead
in interfaceio.netty.channel.socket.DatagramChannelConfig
- Overrides:
setMaxMessagesPerRead
in classio.netty.channel.DefaultChannelConfig
-
getSendBufferSize
public int getSendBufferSize()
- Specified by:
getSendBufferSize
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setSendBufferSize
public IOUringDatagramChannelConfig setSendBufferSize(int sendBufferSize)
- Specified by:
setSendBufferSize
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
getReceiveBufferSize
public int getReceiveBufferSize()
- Specified by:
getReceiveBufferSize
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setReceiveBufferSize
public IOUringDatagramChannelConfig setReceiveBufferSize(int receiveBufferSize)
- Specified by:
setReceiveBufferSize
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
getTrafficClass
public int getTrafficClass()
- Specified by:
getTrafficClass
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setTrafficClass
public IOUringDatagramChannelConfig setTrafficClass(int trafficClass)
- Specified by:
setTrafficClass
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
isReuseAddress
public boolean isReuseAddress()
- Specified by:
isReuseAddress
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setReuseAddress
public IOUringDatagramChannelConfig setReuseAddress(boolean reuseAddress)
- Specified by:
setReuseAddress
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
isBroadcast
public boolean isBroadcast()
- Specified by:
isBroadcast
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setBroadcast
public IOUringDatagramChannelConfig setBroadcast(boolean broadcast)
- Specified by:
setBroadcast
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
isLoopbackModeDisabled
public boolean isLoopbackModeDisabled()
- Specified by:
isLoopbackModeDisabled
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setLoopbackModeDisabled
public IOUringDatagramChannelConfig setLoopbackModeDisabled(boolean loopbackModeDisabled)
- Specified by:
setLoopbackModeDisabled
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
getTimeToLive
public int getTimeToLive()
- Specified by:
getTimeToLive
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setTimeToLive
public IOUringDatagramChannelConfig setTimeToLive(int ttl)
- Specified by:
setTimeToLive
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
getInterface
public java.net.InetAddress getInterface()
- Specified by:
getInterface
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setInterface
public IOUringDatagramChannelConfig setInterface(java.net.InetAddress interfaceAddress)
- Specified by:
setInterface
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
getNetworkInterface
public java.net.NetworkInterface getNetworkInterface()
- Specified by:
getNetworkInterface
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
setNetworkInterface
public IOUringDatagramChannelConfig setNetworkInterface(java.net.NetworkInterface networkInterface)
- Specified by:
setNetworkInterface
in interfaceio.netty.channel.socket.DatagramChannelConfig
-
isReusePort
public boolean isReusePort()
Returnstrue
if the SO_REUSEPORT option is set.
-
setReusePort
public IOUringDatagramChannelConfig setReusePort(boolean reusePort)
Set the SO_REUSEPORT option on the underlying Channel. This will allow to bind multipleDatagramChannel
s to the same port and so receive datagrams with multiple threads. Be aware this method needs be called beforeChannelOutboundInvoker.bind(java.net.SocketAddress)
to have any affect.
-
isIpTransparent
public boolean isIpTransparent()
-
setIpTransparent
public IOUringDatagramChannelConfig setIpTransparent(boolean ipTransparent)
-
isFreeBind
public boolean isFreeBind()
-
setFreeBind
public IOUringDatagramChannelConfig setFreeBind(boolean freeBind)
-
setMaxDatagramPayloadSize
public IOUringDatagramChannelConfig setMaxDatagramPayloadSize(int maxDatagramSize)
Set the maximumDatagramPacket
size. This will be used to determine if a batch ofIORING_IO_RECVMSG
should be used when reading from the underlying socket. When batchedrecvmmsg
is used we may be able to read multipleDatagramPacket
s with one syscall and so greatly improve the performance. This number will be used to sliceByteBuf
s returned by the usedRecvByteBufAllocator
. You can use0
to disable the usage of batching, any other bigger value will enable it.
-
getMaxDatagramPayloadSize
public int getMaxDatagramPayloadSize()
Get the maximumDatagramPacket
size.
-
-