Package io.netty.channel.epoll
Class EpollDatagramChannelConfig
- java.lang.Object
-
- io.netty.channel.DefaultChannelConfig
-
- io.netty.channel.epoll.EpollChannelConfig
-
- io.netty.channel.epoll.EpollDatagramChannelConfig
-
- All Implemented Interfaces:
io.netty.channel.ChannelConfig,io.netty.channel.socket.DatagramChannelConfig
public final class EpollDatagramChannelConfig extends EpollChannelConfig implements io.netty.channel.socket.DatagramChannelConfig
-
-
Method Summary
-
Methods inherited from class io.netty.channel.epoll.EpollChannelConfig
autoReadCleared, getEpollMode, getMaxBytesPerGatheringWrite, setMaxBytesPerGatheringWrite, socket
-
Methods inherited from class io.netty.channel.DefaultChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, 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
-
-
-
-
Method Detail
-
getOptions
public Map<io.netty.channel.ChannelOption<?>,Object> getOptions()
- Specified by:
getOptionsin interfaceio.netty.channel.ChannelConfig- Overrides:
getOptionsin classEpollChannelConfig
-
getOption
public <T> T getOption(io.netty.channel.ChannelOption<T> option)
- Specified by:
getOptionin interfaceio.netty.channel.ChannelConfig- Overrides:
getOptionin classEpollChannelConfig
-
setOption
public <T> boolean setOption(io.netty.channel.ChannelOption<T> option, T value)- Specified by:
setOptionin interfaceio.netty.channel.ChannelConfig- Overrides:
setOptionin classEpollChannelConfig
-
setMessageSizeEstimator
public EpollDatagramChannelConfig setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)
- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setMessageSizeEstimatorin classEpollChannelConfig
-
setWriteBufferLowWaterMark
@Deprecated public EpollDatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.- Specified by:
setWriteBufferLowWaterMarkin interfaceio.netty.channel.ChannelConfig- Overrides:
setWriteBufferLowWaterMarkin classEpollChannelConfig
-
setWriteBufferHighWaterMark
@Deprecated public EpollDatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.- Specified by:
setWriteBufferHighWaterMarkin interfaceio.netty.channel.ChannelConfig- Overrides:
setWriteBufferHighWaterMarkin classEpollChannelConfig
-
setWriteBufferWaterMark
public EpollDatagramChannelConfig setWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)
- Specified by:
setWriteBufferWaterMarkin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteBufferWaterMarkin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setWriteBufferWaterMarkin classEpollChannelConfig
-
setAutoClose
public EpollDatagramChannelConfig setAutoClose(boolean autoClose)
- Specified by:
setAutoClosein interfaceio.netty.channel.ChannelConfig- Specified by:
setAutoClosein interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setAutoClosein classio.netty.channel.DefaultChannelConfig
-
setAutoRead
public EpollDatagramChannelConfig setAutoRead(boolean autoRead)
- Specified by:
setAutoReadin interfaceio.netty.channel.ChannelConfig- Specified by:
setAutoReadin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setAutoReadin classEpollChannelConfig
-
setRecvByteBufAllocator
public EpollDatagramChannelConfig setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)
- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setRecvByteBufAllocatorin classEpollChannelConfig
-
setWriteSpinCount
public EpollDatagramChannelConfig setWriteSpinCount(int writeSpinCount)
- Specified by:
setWriteSpinCountin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteSpinCountin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setWriteSpinCountin classEpollChannelConfig
-
setAllocator
public EpollDatagramChannelConfig setAllocator(io.netty.buffer.ByteBufAllocator allocator)
- Specified by:
setAllocatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setAllocatorin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setAllocatorin classEpollChannelConfig
-
setConnectTimeoutMillis
public EpollDatagramChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
- Specified by:
setConnectTimeoutMillisin interfaceio.netty.channel.ChannelConfig- Specified by:
setConnectTimeoutMillisin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setConnectTimeoutMillisin classEpollChannelConfig
-
setMaxMessagesPerRead
@Deprecated public EpollDatagramChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.- Specified by:
setMaxMessagesPerReadin interfaceio.netty.channel.ChannelConfig- Specified by:
setMaxMessagesPerReadin interfaceio.netty.channel.socket.DatagramChannelConfig- Overrides:
setMaxMessagesPerReadin classEpollChannelConfig
-
getSendBufferSize
public int getSendBufferSize()
- Specified by:
getSendBufferSizein interfaceio.netty.channel.socket.DatagramChannelConfig
-
setSendBufferSize
public EpollDatagramChannelConfig setSendBufferSize(int sendBufferSize)
- Specified by:
setSendBufferSizein interfaceio.netty.channel.socket.DatagramChannelConfig
-
getReceiveBufferSize
public int getReceiveBufferSize()
- Specified by:
getReceiveBufferSizein interfaceio.netty.channel.socket.DatagramChannelConfig
-
setReceiveBufferSize
public EpollDatagramChannelConfig setReceiveBufferSize(int receiveBufferSize)
- Specified by:
setReceiveBufferSizein interfaceio.netty.channel.socket.DatagramChannelConfig
-
getTrafficClass
public int getTrafficClass()
- Specified by:
getTrafficClassin interfaceio.netty.channel.socket.DatagramChannelConfig
-
setTrafficClass
public EpollDatagramChannelConfig setTrafficClass(int trafficClass)
- Specified by:
setTrafficClassin interfaceio.netty.channel.socket.DatagramChannelConfig
-
isReuseAddress
public boolean isReuseAddress()
- Specified by:
isReuseAddressin interfaceio.netty.channel.socket.DatagramChannelConfig
-
setReuseAddress
public EpollDatagramChannelConfig setReuseAddress(boolean reuseAddress)
- Specified by:
setReuseAddressin interfaceio.netty.channel.socket.DatagramChannelConfig
-
isBroadcast
public boolean isBroadcast()
- Specified by:
isBroadcastin interfaceio.netty.channel.socket.DatagramChannelConfig
-
setBroadcast
public EpollDatagramChannelConfig setBroadcast(boolean broadcast)
- Specified by:
setBroadcastin interfaceio.netty.channel.socket.DatagramChannelConfig
-
isLoopbackModeDisabled
public boolean isLoopbackModeDisabled()
- Specified by:
isLoopbackModeDisabledin interfaceio.netty.channel.socket.DatagramChannelConfig
-
setLoopbackModeDisabled
public io.netty.channel.socket.DatagramChannelConfig setLoopbackModeDisabled(boolean loopbackModeDisabled)
- Specified by:
setLoopbackModeDisabledin interfaceio.netty.channel.socket.DatagramChannelConfig
-
getTimeToLive
public int getTimeToLive()
- Specified by:
getTimeToLivein interfaceio.netty.channel.socket.DatagramChannelConfig
-
setTimeToLive
public EpollDatagramChannelConfig setTimeToLive(int ttl)
- Specified by:
setTimeToLivein interfaceio.netty.channel.socket.DatagramChannelConfig
-
getInterface
public InetAddress getInterface()
- Specified by:
getInterfacein interfaceio.netty.channel.socket.DatagramChannelConfig
-
setInterface
public EpollDatagramChannelConfig setInterface(InetAddress interfaceAddress)
- Specified by:
setInterfacein interfaceio.netty.channel.socket.DatagramChannelConfig
-
getNetworkInterface
public NetworkInterface getNetworkInterface()
- Specified by:
getNetworkInterfacein interfaceio.netty.channel.socket.DatagramChannelConfig
-
setNetworkInterface
public EpollDatagramChannelConfig setNetworkInterface(NetworkInterface networkInterface)
- Specified by:
setNetworkInterfacein interfaceio.netty.channel.socket.DatagramChannelConfig
-
setEpollMode
public EpollDatagramChannelConfig setEpollMode(EpollMode mode)
Description copied from class:EpollChannelConfigSet theEpollModeused. Default isEpollMode.EDGE_TRIGGERED. If you want to useDefaultChannelConfig.isAutoRead()falseorDefaultChannelConfig.getMaxMessagesPerRead()and have an accurate behaviour you should useEpollMode.LEVEL_TRIGGERED. Be aware this config setting can only be adjusted before the channel was registered.- Overrides:
setEpollModein classEpollChannelConfig
-
isReusePort
public boolean isReusePort()
Returnstrueif the SO_REUSEPORT option is set.
-
setReusePort
public EpollDatagramChannelConfig setReusePort(boolean reusePort)
Set the SO_REUSEPORT option on the underlying Channel. This will allow to bind multipleEpollSocketChannels to the same port and so accept connections with multiple threads. Be aware this method needs be called beforeChannel.bind(java.net.SocketAddress)to have any affect.
-
isIpTransparent
public boolean isIpTransparent()
-
setIpTransparent
public EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent)
-
isFreeBind
public boolean isFreeBind()
-
setFreeBind
public EpollDatagramChannelConfig setFreeBind(boolean freeBind)
-
isIpRecvOrigDestAddr
public boolean isIpRecvOrigDestAddr()
-
setIpRecvOrigDestAddr
public EpollDatagramChannelConfig setIpRecvOrigDestAddr(boolean ipTransparent)
-
setMaxDatagramPayloadSize
public EpollDatagramChannelConfig setMaxDatagramPayloadSize(int maxDatagramSize)
Set the maximumDatagramPacketsize. This will be used to determine ifrecvmmsgshould be used when reading from the underlying socket. Whenrecvmmsgis used we may be able to read multipleDatagramPackets with one syscall and so greatly improve the performance. This number will be used to sliceByteBufs returned by the usedRecvByteBufAllocator. You can use0to disable the usage of recvmmsg, any other bigger value will enable it.
-
getMaxDatagramPayloadSize
public int getMaxDatagramPayloadSize()
Get the maximumDatagramPacketsize.
-
setUdpGro
public EpollDatagramChannelConfig setUdpGro(boolean gro)
Enable / disable UDP_GRO.- Parameters:
gro-trueifUDP_GROshould be enabled,falseotherwise.- Returns:
- this.
-
isUdpGro
public boolean isUdpGro()
Returns ifUDP_GROis enabled.- Returns:
trueif enabled,falseotherwise.
-
setMaxMessagesPerWrite
public EpollDatagramChannelConfig setMaxMessagesPerWrite(int maxMessagesPerWrite)
- Overrides:
setMaxMessagesPerWritein classio.netty.channel.DefaultChannelConfig
-
-