Top Fields Constructors Methods
io.netty.channel.epoll

public final Class EpollDatagramChannelConfig

extends EpollChannelConfig
implements DatagramChannelConfig
Class Inheritance
All Implemented Interfaces
io.netty.channel.socket.DatagramChannelConfig, io.netty.channel.ChannelConfig
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, io.netty.channel.ChannelException, .ChannelOption, .FixedRecvByteBufAllocator, .MessageSizeEstimator, .RecvByteBufAllocator, .WriteBufferWaterMark, io.netty.channel.socket.DatagramChannelConfig, io.netty.util.internal.ObjectUtil, java.io.IOException, java.net.InetAddress, .NetworkInterface, java.util.Map

Field Summary

Modifier and TypeField and Description
private boolean
private volatile boolean
private volatile int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
public InetAddress
getInterface()

Implements io.netty.channel.socket.DatagramChannelConfig.getInterface.

Gets the address of the network interface used for multicast packets.
public int
public NetworkInterface
public <T> T
public Map<ChannelOption<?>, Object>
public int
public int
public int
public int
public boolean
public boolean
isFreeBind()

Returns true if IP_FREEBIND is enabled, false otherwise.

public boolean
isIpRecvOrigDestAddr()

Returns true if IP_RECVORIGDSTADDR is enabled, false otherwise.

public boolean
isIpTransparent()

Returns true if IP_TRANSPARENT is enabled, false otherwise.

public boolean
public boolean
public boolean
isReusePort()

Returns true if the SO_REUSEPORT option is set.

public boolean

Returns:

true if enabled, false otherwise.
isUdpGro
()

Returns if UDP_GRO is enabled.

private void
setActiveOnOpen(boolean activeOnOpen)

public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
setAutoClose(boolean autoClose)

Overrides io.netty.channel.DefaultChannelConfig.setAutoClose.

Implements io.netty.channel.socket.DatagramChannelConfig.setAutoClose, io.netty.channel.ChannelConfig.setAutoClose.

Sets whether the Channel should be closed automatically and immediately on write failure.
public EpollDatagramChannelConfig
setAutoRead(boolean autoRead)

Overrides io.netty.channel.epoll.EpollChannelConfig.setAutoRead.

Implements io.netty.channel.socket.DatagramChannelConfig.setAutoRead, io.netty.channel.ChannelConfig.setAutoRead.

Sets if ChannelHandlerContext#read() will be invoked automatically so that a user application doesn't need to call it at all.
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
setConnectTimeoutMillis(int
the connect timeout in milliseconds. 0 to disable.
connectTimeoutMillis
)

Overrides io.netty.channel.epoll.EpollChannelConfig.setConnectTimeoutMillis.

Implements io.netty.channel.socket.DatagramChannelConfig.setConnectTimeoutMillis, io.netty.channel.ChannelConfig.setConnectTimeoutMillis.

Sets the connect timeout of the channel in milliseconds.
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
setFreeBind(boolean freeBind)

If true is used IP_FREEBIND is enabled, false for disable it.

public EpollDatagramChannelConfig
setInterface(InetAddress interfaceAddress)

Implements io.netty.channel.socket.DatagramChannelConfig.setInterface.

Sets the address of the network interface used for multicast packets.
public EpollDatagramChannelConfig
setIpRecvOrigDestAddr(boolean ipTransparent)

If true is used IP_RECVORIGDSTADDR is enabled, false for disable it.

public EpollDatagramChannelConfig
setIpTransparent(boolean ipTransparent)

If true is used IP_TRANSPARENT is enabled, false for disable it.

public DatagramChannelConfig
setLoopbackModeDisabled(boolean
true if and only if the loopback mode has been disabled
loopbackModeDisabled
)

Implements io.netty.channel.socket.DatagramChannelConfig.setLoopbackModeDisabled.

Sets the StandardSocketOptions#IP_MULTICAST_LOOP option.
public EpollDatagramChannelConfig
setMaxDatagramPayloadSize(int maxDatagramSize)

Set the maximum io.netty.channel.socket.DatagramPacket size.

public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
setMaxMessagesPerWrite(int maxMessagesPerWrite)

Overrides io.netty.channel.DefaultChannelConfig.setMaxMessagesPerWrite.

Set the maximum number of message to write per eventloop run.
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
public <T> boolean
setOption(ChannelOption<T> option, T value)

Overrides io.netty.channel.epoll.EpollChannelConfig.setOption.

Implements io.netty.channel.ChannelConfig.setOption.

Sets a configuration property with the specified name and value.
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
setReusePort(boolean reusePort)

Set the SO_REUSEPORT option on the underlying Channel.

public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
public EpollDatagramChannelConfig

Returns:

this.
setUdpGro
(boolean
true if UDP_GRO should be enabled, false otherwise.
gro
)

Enable / disable UDP_GRO.

public EpollDatagramChannelConfig
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)

Overrides io.netty.channel.epoll.EpollChannelConfig.setWriteBufferHighWaterMark.

Implements io.netty.channel.ChannelConfig.setWriteBufferHighWaterMark.

Deprecated

Sets the high water mark of the write buffer.

public EpollDatagramChannelConfig
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)

Overrides io.netty.channel.epoll.EpollChannelConfig.setWriteBufferLowWaterMark.

Implements io.netty.channel.ChannelConfig.setWriteBufferLowWaterMark.

Deprecated

Sets the low water mark of the write buffer.

public EpollDatagramChannelConfig
public EpollDatagramChannelConfig
Inherited from io.netty.channel.epoll.EpollChannelConfig:
autoReadClearedgetEpollModegetMaxBytesPerGatheringWritesetMaxBytesPerGatheringWritesocket

Field Detail

activeOnOpenback to summary
private boolean activeOnOpen
groback to summary
private volatile boolean gro
maxDatagramSizeback to summary
private volatile int maxDatagramSize

Constructor Detail

EpollDatagramChannelConfigback to summary
pack-priv EpollDatagramChannelConfig(EpollDatagramChannel channel)

Method Detail

getActiveOnOpenback to summary
pack-priv boolean getActiveOnOpen()
getInterfaceback to summary
public InetAddress getInterface()

Implements io.netty.channel.socket.DatagramChannelConfig.getInterface.

Doc from io.netty.channel.socket.DatagramChannelConfig.getInterface.

Gets the address of the network interface used for multicast packets.

Annotations
@Override
getMaxDatagramPayloadSizeback to summary
public int getMaxDatagramPayloadSize()

Get the maximum io.netty.channel.socket.DatagramPacket size.

getNetworkInterfaceback to summary
public NetworkInterface getNetworkInterface()

Implements io.netty.channel.socket.DatagramChannelConfig.getNetworkInterface.

Doc from io.netty.channel.socket.DatagramChannelConfig.getNetworkInterface.

Gets the StandardSocketOptions#IP_MULTICAST_IF option.

Annotations
@Override
getOptionback to summary
public <T> T getOption(ChannelOption<T> option)

Overrides io.netty.channel.epoll.EpollChannelConfig.getOption.

Implements io.netty.channel.ChannelConfig.getOption.

Doc from io.netty.channel.ChannelConfig.getOption.

Return the value of the given ChannelOption

Annotations
@SuppressWarnings:unchecked, deprecation
@Override
getOptionsback to summary
public Map<ChannelOption<?>, Object> getOptions()

Overrides io.netty.channel.epoll.EpollChannelConfig.getOptions.

Implements io.netty.channel.ChannelConfig.getOptions.

Doc from io.netty.channel.ChannelConfig.getOptions.

Return all set ChannelOption's.

Annotations
@Override
@SuppressWarnings:deprecation
getReceiveBufferSizeback to summary
public int getReceiveBufferSize()

Implements io.netty.channel.socket.DatagramChannelConfig.getReceiveBufferSize.

Doc from io.netty.channel.socket.DatagramChannelConfig.getReceiveBufferSize.

Gets the StandardSocketOptions#SO_RCVBUF option.

Annotations
@Override
getSendBufferSizeback to summary
public int getSendBufferSize()

Implements io.netty.channel.socket.DatagramChannelConfig.getSendBufferSize.

Doc from io.netty.channel.socket.DatagramChannelConfig.getSendBufferSize.

Gets the StandardSocketOptions#SO_SNDBUF option.

Annotations
@Override
getTimeToLiveback to summary
public int getTimeToLive()

Implements io.netty.channel.socket.DatagramChannelConfig.getTimeToLive.

Doc from io.netty.channel.socket.DatagramChannelConfig.getTimeToLive.

Gets the StandardSocketOptions#IP_MULTICAST_TTL option.

Annotations
@Override
getTrafficClassback to summary
public int getTrafficClass()

Implements io.netty.channel.socket.DatagramChannelConfig.getTrafficClass.

Doc from io.netty.channel.socket.DatagramChannelConfig.getTrafficClass.

Gets the StandardSocketOptions#IP_TOS option.

Annotations
@Override
isBroadcastback to summary
public boolean isBroadcast()

Implements io.netty.channel.socket.DatagramChannelConfig.isBroadcast.

Doc from io.netty.channel.socket.DatagramChannelConfig.isBroadcast.

Gets the StandardSocketOptions#SO_BROADCAST option.

Annotations
@Override
isFreeBindback to summary
public boolean isFreeBind()

Returns true if IP_FREEBIND is enabled, false otherwise.

isIpRecvOrigDestAddrback to summary
public boolean isIpRecvOrigDestAddr()

Returns true if IP_RECVORIGDSTADDR is enabled, false otherwise.

isIpTransparentback to summary
public boolean isIpTransparent()

Returns true if IP_TRANSPARENT is enabled, false otherwise.

isLoopbackModeDisabledback to summary
public boolean isLoopbackModeDisabled()

Implements io.netty.channel.socket.DatagramChannelConfig.isLoopbackModeDisabled.

Doc from io.netty.channel.socket.DatagramChannelConfig.isLoopbackModeDisabled.

Gets the StandardSocketOptions#IP_MULTICAST_LOOP option.

Returns:boolean

true if and only if the loopback mode has been disabled

Annotations
@Override
isReuseAddressback to summary
public boolean isReuseAddress()

Implements io.netty.channel.socket.DatagramChannelConfig.isReuseAddress.

Doc from io.netty.channel.socket.DatagramChannelConfig.isReuseAddress.

Gets the StandardSocketOptions#SO_REUSEADDR option.

Annotations
@Override
isReusePortback to summary
public boolean isReusePort()

Returns true if the SO_REUSEPORT option is set.

isUdpGroback to summary
public boolean isUdpGro()

Returns if UDP_GRO is enabled.

Returns:boolean

true if enabled, false otherwise.

setActiveOnOpenback to summary
private void setActiveOnOpen(boolean activeOnOpen)
setAllocatorback to summary
public EpollDatagramChannelConfig setAllocator(ByteBufAllocator allocator)

Overrides io.netty.channel.epoll.EpollChannelConfig.setAllocator.

Implements io.netty.channel.socket.DatagramChannelConfig.setAllocator, io.netty.channel.ChannelConfig.setAllocator.

Doc from io.netty.channel.ChannelConfig.setAllocator.

Set the ByteBufAllocator which is used for the channel to allocate buffers.

Annotations
@Override
setAutoCloseback to summary
public EpollDatagramChannelConfig setAutoClose(boolean autoClose)

Overrides io.netty.channel.DefaultChannelConfig.setAutoClose.

Implements io.netty.channel.socket.DatagramChannelConfig.setAutoClose, io.netty.channel.ChannelConfig.setAutoClose.

Doc from io.netty.channel.ChannelConfig.setAutoClose.

Sets whether the Channel should be closed automatically and immediately on write failure. The default is true.

Annotations
@Override
setAutoReadback to summary
public EpollDatagramChannelConfig setAutoRead(boolean autoRead)

Overrides io.netty.channel.epoll.EpollChannelConfig.setAutoRead.

Implements io.netty.channel.socket.DatagramChannelConfig.setAutoRead, io.netty.channel.ChannelConfig.setAutoRead.

Doc from io.netty.channel.ChannelConfig.setAutoRead.

Sets if ChannelHandlerContext#read() will be invoked automatically so that a user application doesn't need to call it at all. The default value is true.

Annotations
@Override
setBroadcastback to summary
public EpollDatagramChannelConfig setBroadcast(boolean broadcast)

Implements io.netty.channel.socket.DatagramChannelConfig.setBroadcast.

Doc from io.netty.channel.socket.DatagramChannelConfig.setBroadcast.

Sets the StandardSocketOptions#SO_BROADCAST option.

Annotations
@Override
setConnectTimeoutMillisback to summary
public EpollDatagramChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)

Overrides io.netty.channel.epoll.EpollChannelConfig.setConnectTimeoutMillis.

Implements io.netty.channel.socket.DatagramChannelConfig.setConnectTimeoutMillis, io.netty.channel.ChannelConfig.setConnectTimeoutMillis.

Doc from io.netty.channel.ChannelConfig.setConnectTimeoutMillis.

Sets the connect timeout of the channel in milliseconds. If the Channel does not support connect operation, this property is not used at all, and therefore will be ignored.

Parameters
connectTimeoutMillis:int

the connect timeout in milliseconds. 0 to disable.

Annotations
@Override
setEpollModeback to summary
public EpollDatagramChannelConfig setEpollMode(EpollMode mode)

Overrides io.netty.channel.epoll.EpollChannelConfig.setEpollMode.

Doc from io.netty.channel.epoll.EpollChannelConfig.setEpollMode.

Set the EpollMode used. Default is EpollMode#EDGE_TRIGGERED. If you want to use isAutoRead() false or getMaxMessagesPerRead() and have an accurate behaviour you should use EpollMode#LEVEL_TRIGGERED. Be aware this config setting can only be adjusted before the channel was registered.

Annotations
@Override
setFreeBindback to summary
public EpollDatagramChannelConfig setFreeBind(boolean freeBind)

If true is used IP_FREEBIND is enabled, false for disable it. Default is disabled.

setInterfaceback to summary
public EpollDatagramChannelConfig setInterface(InetAddress interfaceAddress)

Implements io.netty.channel.socket.DatagramChannelConfig.setInterface.

Doc from io.netty.channel.socket.DatagramChannelConfig.setInterface.

Sets the address of the network interface used for multicast packets.

Annotations
@Override
setIpRecvOrigDestAddrback to summary
public EpollDatagramChannelConfig setIpRecvOrigDestAddr(boolean ipTransparent)

If true is used IP_RECVORIGDSTADDR is enabled, false for disable it. Default is disabled.

setIpTransparentback to summary
public EpollDatagramChannelConfig setIpTransparent(boolean ipTransparent)

If true is used IP_TRANSPARENT is enabled, false for disable it. Default is disabled.

setLoopbackModeDisabledback to summary
public DatagramChannelConfig setLoopbackModeDisabled(boolean loopbackModeDisabled)

Implements io.netty.channel.socket.DatagramChannelConfig.setLoopbackModeDisabled.

Doc from io.netty.channel.socket.DatagramChannelConfig.setLoopbackModeDisabled.

Sets the StandardSocketOptions#IP_MULTICAST_LOOP option.

Parameters
loopbackModeDisabled:boolean

true if and only if the loopback mode has been disabled

Annotations
@Override
setMaxDatagramPayloadSizeback to summary
public EpollDatagramChannelConfig setMaxDatagramPayloadSize(int maxDatagramSize)

Set the maximum io.netty.channel.socket.DatagramPacket size. This will be used to determine if recvmmsg should be used when reading from the underlying socket. When recvmmsg is used we may be able to read multiple io.netty.channel.socket.DatagramPackets with one syscall and so greatly improve the performance. This number will be used to slice ByteBufs returned by the used RecvByteBufAllocator. You can use 0 to disable the usage of recvmmsg, any other bigger value will enable it.

setMaxMessagesPerReadback to summary
public EpollDatagramChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)

Overrides io.netty.channel.epoll.EpollChannelConfig.setMaxMessagesPerRead.

Implements io.netty.channel.socket.DatagramChannelConfig.setMaxMessagesPerRead, io.netty.channel.ChannelConfig.setMaxMessagesPerRead.

Doc from io.netty.channel.DefaultChannelConfig.setMaxMessagesPerRead.

Deprecated

Annotations
@Override
@Deprecated
setMaxMessagesPerWriteback to summary
public EpollDatagramChannelConfig setMaxMessagesPerWrite(int maxMessagesPerWrite)

Overrides io.netty.channel.DefaultChannelConfig.setMaxMessagesPerWrite.

Doc from io.netty.channel.DefaultChannelConfig.setMaxMessagesPerWrite.

Set the maximum number of message to write per eventloop run. Once this limit is reached we will continue to process other events before trying to write the remaining messages.

Annotations
@Override
setMessageSizeEstimatorback to summary
public EpollDatagramChannelConfig setMessageSizeEstimator(MessageSizeEstimator estimator)

Overrides io.netty.channel.epoll.EpollChannelConfig.setMessageSizeEstimator.

Implements io.netty.channel.socket.DatagramChannelConfig.setMessageSizeEstimator, io.netty.channel.ChannelConfig.setMessageSizeEstimator.

Doc from io.netty.channel.ChannelConfig.setMessageSizeEstimator.

Set the MessageSizeEstimator which is used for the channel to detect the size of a message.

Annotations
@Override
setNetworkInterfaceback to summary
public EpollDatagramChannelConfig setNetworkInterface(NetworkInterface networkInterface)

Implements io.netty.channel.socket.DatagramChannelConfig.setNetworkInterface.

Doc from io.netty.channel.socket.DatagramChannelConfig.setNetworkInterface.

Sets the StandardSocketOptions#IP_MULTICAST_IF option.

Annotations
@Override
setOptionback to summary
public <T> boolean setOption(ChannelOption<T> option, T value)

Overrides io.netty.channel.epoll.EpollChannelConfig.setOption.

Implements io.netty.channel.ChannelConfig.setOption.

Doc from io.netty.channel.ChannelConfig.setOption.

Sets a configuration property with the specified name and value. To override this method properly, you must call the super class:

public boolean setOption(ChannelOption<T> option, T value) {
    if (super.setOption(option, value)) {
        return true;
    }

    if (option.equals(additionalOption)) {
        ....
        return true;
    }

    return false;
}
Returns:boolean

true if and only if the property has been set

Annotations
@Override
@SuppressWarnings:deprecation
setReceiveBufferSizeback to summary
public EpollDatagramChannelConfig setReceiveBufferSize(int receiveBufferSize)

Implements io.netty.channel.socket.DatagramChannelConfig.setReceiveBufferSize.

Doc from io.netty.channel.socket.DatagramChannelConfig.setReceiveBufferSize.

Sets the StandardSocketOptions#SO_RCVBUF option.

Annotations
@Override
setRecvByteBufAllocatorback to summary
public EpollDatagramChannelConfig setRecvByteBufAllocator(RecvByteBufAllocator allocator)

Overrides io.netty.channel.epoll.EpollChannelConfig.setRecvByteBufAllocator.

Implements io.netty.channel.socket.DatagramChannelConfig.setRecvByteBufAllocator, io.netty.channel.ChannelConfig.setRecvByteBufAllocator.

Doc from io.netty.channel.ChannelConfig.setRecvByteBufAllocator.

Set the RecvByteBufAllocator which is used for the channel to allocate receive buffers.

Annotations
@Override
setReuseAddressback to summary
public EpollDatagramChannelConfig setReuseAddress(boolean reuseAddress)

Implements io.netty.channel.socket.DatagramChannelConfig.setReuseAddress.

Doc from io.netty.channel.socket.DatagramChannelConfig.setReuseAddress.

Gets the StandardSocketOptions#SO_REUSEADDR option.

Annotations
@Override
setReusePortback to summary
public EpollDatagramChannelConfig setReusePort(boolean reusePort)

Set the SO_REUSEPORT option on the underlying Channel. This will allow to bind multiple EpollSocketChannels to the same port and so accept connections with multiple threads. Be aware this method needs be called before EpollDatagramChannel#bind(java.net.SocketAddress) to have any affect.

setSendBufferSizeback to summary
public EpollDatagramChannelConfig setSendBufferSize(int sendBufferSize)

Implements io.netty.channel.socket.DatagramChannelConfig.setSendBufferSize.

Doc from io.netty.channel.socket.DatagramChannelConfig.setSendBufferSize.

Sets the StandardSocketOptions#SO_SNDBUF option.

Annotations
@Override
setTimeToLiveback to summary
public EpollDatagramChannelConfig setTimeToLive(int ttl)

Implements io.netty.channel.socket.DatagramChannelConfig.setTimeToLive.

Doc from io.netty.channel.socket.DatagramChannelConfig.setTimeToLive.

Sets the StandardSocketOptions#IP_MULTICAST_TTL option.

Annotations
@Override
setTrafficClassback to summary
public EpollDatagramChannelConfig setTrafficClass(int trafficClass)

Implements io.netty.channel.socket.DatagramChannelConfig.setTrafficClass.

Doc from io.netty.channel.socket.DatagramChannelConfig.setTrafficClass.

Sets the StandardSocketOptions#IP_TOS option.

Annotations
@Override
setUdpGroback to summary
public EpollDatagramChannelConfig setUdpGro(boolean gro)

Enable / disable UDP_GRO.

Parameters
gro:boolean

true if UDP_GRO should be enabled, false otherwise.

Returns:EpollDatagramChannelConfig

this.

setWriteBufferHighWaterMarkback to summary
public EpollDatagramChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)

Overrides io.netty.channel.epoll.EpollChannelConfig.setWriteBufferHighWaterMark.

Implements io.netty.channel.ChannelConfig.setWriteBufferHighWaterMark.

Doc from io.netty.channel.ChannelConfig.setWriteBufferHighWaterMark.

Deprecated

Sets the high water mark of the write buffer. If the number of bytes queued in the write buffer exceeds this value, Channel#isWritable() will start to return false.

Annotations
@Override
@Deprecated
setWriteBufferLowWaterMarkback to summary
public EpollDatagramChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)

Overrides io.netty.channel.epoll.EpollChannelConfig.setWriteBufferLowWaterMark.

Implements io.netty.channel.ChannelConfig.setWriteBufferLowWaterMark.

Doc from io.netty.channel.ChannelConfig.setWriteBufferLowWaterMark.

Deprecated

Sets the low water mark of the write buffer. Once the number of bytes queued in the write buffer exceeded the high water mark and then dropped down below this value, Channel#isWritable() will start to return true again.

Annotations
@Override
@Deprecated
setWriteBufferWaterMarkback to summary
public EpollDatagramChannelConfig setWriteBufferWaterMark(WriteBufferWaterMark writeBufferWaterMark)

Overrides io.netty.channel.epoll.EpollChannelConfig.setWriteBufferWaterMark.

Implements io.netty.channel.socket.DatagramChannelConfig.setWriteBufferWaterMark, io.netty.channel.ChannelConfig.setWriteBufferWaterMark.

Doc from io.netty.channel.ChannelConfig.setWriteBufferWaterMark.

Set the WriteBufferWaterMark which is used for setting the high and low water mark of the write buffer.

Annotations
@Override
setWriteSpinCountback to summary
public EpollDatagramChannelConfig setWriteSpinCount(int writeSpinCount)

Overrides io.netty.channel.epoll.EpollChannelConfig.setWriteSpinCount.

Implements io.netty.channel.socket.DatagramChannelConfig.setWriteSpinCount, io.netty.channel.ChannelConfig.setWriteSpinCount.

Doc from io.netty.channel.ChannelConfig.setWriteSpinCount.

Sets the maximum loop count for a write operation until WritableByteChannel#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 is 16.

Annotations
@Override