Top Description Fields Constructors Methods
io.netty5.channel.epoll

public final Class EpollDatagramChannel

extends AbstractEpollChannel<UnixChannel>
implements DatagramChannel
Class Inheritance
All Implemented Interfaces
io.netty5.channel.socket.DatagramChannel, io.netty5.channel.Channel, io.netty5.channel.IoHandle, java.lang.Comparable, io.netty5.channel.ChannelOutboundInvoker, io.netty5.util.concurrent.FuturePromiseFactory, io.netty5.util.AttributeMap
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelException, .ChannelOption, .ChannelShutdownDirection, .FixedReadHandleFactory, .MaxMessagesWriteHandleFactory, .ReadHandleFactory, .AddressedEnvelope, .DefaultBufferAddressedEnvelope, .EventLoop, io.netty5.channel.socket.DomainSocketAddress, .SocketProtocolFamily, .DatagramChannel, .DatagramPacket, io.netty5.channel.unix.DomainDatagramSocketAddress, .IntegerUnixChannelOption, .RawUnixChannelOption, .UnixChannel, .UnixChannelOption, .Errors, .Errors.NativeIoException, .SegmentedDatagramPacket, .UnixChannelUtil, io.netty5.util.Resource, io.netty5.util.concurrent.Future, .Promise, io.netty5.util.internal.ObjectUtil, .RecyclableArrayList, .SilentDispose, .StringUtil, io.netty5.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.io.IOException, java.net.Inet4Address, .InetAddress, .InetSocketAddress, .NetworkInterface, .PortUnreachableException, .ProtocolFamily, .SocketAddress, .SocketException, java.util.Set

DatagramChannel implementation that uses linux EPOLL Edge-Triggered Mode for maximal performance.

Available options

In addition to the options provided by DatagramChannel and UnixChannel, EpollDatagramChannel allows the following options in the option map:
ChannelOption INET INET6 {@code UNIX
IntegerUnixChannelOptionXXX
RawUnixChannelOptionXXX
UnixChannelOption#SO_REUSEPORTXXX
EpollChannelOption#IP_FREEBINDXX-
EpollChannelOption#IP_RECVORIGDSTADDRXX-
EpollChannelOption#MAX_DATAGRAM_PAYLOAD_SIZEXX-
EpollChannelOption#UDP_GROXX-

Field Summary

Modifier and TypeField and Description
private volatile boolean
private volatile boolean
private static final String
private static final String
private volatile boolean
private volatile boolean
private static final InternalLogger
private volatile int
private static final Object
private volatile boolean
private static final Set<ChannelOption<?>>
private static final Set<ChannelOption<?>>
Inherited from io.netty5.channel.epoll.AbstractEpollChannel:
activesocket

Constructor Summary

AccessConstructor and Description
public
EpollDatagramChannel(EventLoop eventLoop)

Create a new instance which selects the ProtocolFamily to use depending on the Operation Systems default which will be chosen.

public
EpollDatagramChannel(EventLoop eventLoop, ProtocolFamily family)

Create a new instance using the given ProtocolFamily.

public
EpollDatagramChannel(EventLoop eventLoop, int fd, ProtocolFamily family)

Create a new instance which selects the ProtocolFamily to use depending on the Operation Systems default which will be chosen.

private
EpollDatagramChannel(EventLoop eventLoop, LinuxSocket fd, boolean active)

Method Summary

Modifier and TypeMethod and Description
private static void
public Future<Void>
block(InetAddress
the multicast group address.
multicastAddress
,
NetworkInterface
the interface to use.
networkInterface
,
InetAddress
the source address.
sourceToBlock
)

Implements io.netty5.channel.socket.DatagramChannel.block.

Block the given sourceToBlock address for the given multicastAddress on the given networkInterface and notifies the Future once the operation completes.
public Future<Void>
block(InetAddress
the multicast group address.
multicastAddress
,
InetAddress
the source address.
sourceToBlock
)

Implements io.netty5.channel.socket.DatagramChannel.block.

Block the given sourceToBlock address for the given multicastAddress and notifies the Future once the operation completes.
private NativeDatagramPacketArray
private AbstractEpollChannel.ReadState
protected void
protected void
protected boolean
doConnect(SocketAddress
the address of the remote peer.
remoteAddress
,
SocketAddress
the local address of this channel.
localAddress
,
Buffer
the initial data that is written during connect (if ChannelOption#TCP_FASTOPEN_CONNECT is supported and configured). If data is written care must be taken to update the reader offset.
initialData
)

Overrides io.netty5.channel.epoll.AbstractEpollChannel.doConnect.

Connect to the remote peer
protected void
doDisconnect()

Overrides io.netty5.channel.epoll.AbstractEpollChannel.doDisconnect.

Disconnect this Channel from its remote peer
private AbstractEpollChannel.ReadState
private AbstractEpollChannel.ReadState
protected void
doShutdown(ChannelShutdownDirection
the direction to shut down.
direction
)

Implements abstract io.netty5.channel.AbstractChannel.doShutdown.

Shutdown one direction of the Channel.
private void
protected void
doWriteNow(AbstractChannel<UnixChannel, SocketAddress, SocketAddress>.WriteSink
the WriteSink that must be completed with the write progress. WriteSink#complete(long, long, int, boolean) or WriteSink#complete(long, Throwable, boolean) must be called exactly once before this method returns non-exceptional.
writeSink
)

Implements abstract io.netty5.channel.AbstractChannel.doWriteNow.

Called in a loop when writes should be performed until this method returns false or there are no more messages to write.
protected AbstractEpollChannel.ReadState
epollInReady(AbstractChannel<UnixChannel, SocketAddress, SocketAddress>.ReadSink readSink)

Implements abstract io.netty5.channel.epoll.AbstractEpollChannel.epollInReady.

Called once EPOLLIN event is ready to be processed
protected Object
filterOutboundMessage(Object
the message to filter / convert.
msg
)

Overrides io.netty5.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to to the outbound queue of this AbstractChannel, so that the Channel implementation converts the message to another.
private Object
filterOutboundMessage0(Object msg, Class<? extends SocketAddress> recipientClass, String expectedTypes)

pack-priv boolean
protected <T> T
private int
private NetworkInterface
private int
private int
private int
private int
public boolean
isActive()

Overrides io.netty5.channel.epoll.AbstractEpollChannel.isActive.

Implements io.netty5.channel.Channel.isActive.

Return true if the Channel is active and so connected.
private boolean
public boolean
isConnected()

Implements io.netty5.channel.socket.DatagramChannel.isConnected.

Return true if the DatagramChannel is connected to the remote peer.
protected boolean
private boolean
isFreeBind()

Returns true if IP_FREEBIND is enabled, false otherwise.

private boolean
isIpRecvOrigDestAddr()

Returns true if IP_RECVORIGDSTADDR is enabled, false otherwise.

private boolean
isIpTransparent()

Returns true if IP_TRANSPARENT is enabled, false otherwise.

private boolean
private static boolean
private boolean
private boolean
isReusePort()

Returns true if the SO_REUSEPORT option is set.

public static boolean

Returns:

true if supported, false otherwise.
isSegmentedDatagramPacketSupported
()

Returns true if SegmentedDatagramPacket is supported natively.

public boolean
isShutdown(ChannelShutdownDirection direction)

Implements io.netty5.channel.Channel.isShutdown.

Returns true if the ChannelShutdownDirection of the Channel was shutdown before.
private boolean

Returns:

true if enabled, false otherwise.
isUdpGro
()

Returns if UDP_GRO is enabled.

public Future<Void>
joinGroup(InetAddress
the multicast group address.
multicastAddress
)

Implements io.netty5.channel.socket.DatagramChannel.joinGroup.

Joins a multicast group and notifies the Future once the operation completes.
public Future<Void>
joinGroup(InetAddress
the multicast group address.
multicastAddress
,
NetworkInterface
the interface to use.
networkInterface
,
InetAddress
the source address (might be null).
source
)

Implements io.netty5.channel.socket.DatagramChannel.joinGroup.

Joins the specified multicast group at the specified interface and notifies the Future once the operation completes.
private void
joinGroup0(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source, Promise<Void> promise)

public Future<Void>
leaveGroup(InetAddress
the multicast group address.
multicastAddress
)

Implements io.netty5.channel.socket.DatagramChannel.leaveGroup.

Leaves a multicast group and notifies the Future once the operation completes.
public Future<Void>
leaveGroup(InetAddress
the multicast group address.
multicastAddress
,
NetworkInterface
the interface to use.
networkInterface
,
InetAddress
the source address (might be null).
source
)

Implements io.netty5.channel.socket.DatagramChannel.leaveGroup.

Leave the specified multicast group at the specified interface using the specified source and notifies the Future once the operation completes.
private void
leaveGroup0(final InetAddress multicastAddress, final NetworkInterface networkInterface, final InetAddress source, final Promise<Void> promise)

private NetworkInterface
private static void
private AbstractEpollChannel.ReadState
private static void
private AbstractEpollChannel.ReadState
private void
setActiveOnOpen(boolean activeOnOpen)

private void
setBroadcast(boolean broadcast)

protected <T> void
private void
setFreeBind(boolean freeBind)

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

private void
setIpRecvOrigDestAddr(boolean ipTransparent)

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

private void
setIpTransparent(boolean ipTransparent)

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

private void
setLoopbackModeDisabled(boolean loopbackModeDisabled)

private void
setMaxDatagramPayloadSize(int maxDatagramSize)

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

private void
private void
setReceiveBufferSize(int receiveBufferSize)

private void
setReuseAddress(boolean reuseAddress)

private void
setReusePort(boolean reusePort)

Set the SO_REUSEPORT option on the underlying Channel.

private void
setSendBufferSize(int sendBufferSize)

private void
setTimeToLive(int ttl)

private void
setTrafficClass(int trafficClass)

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

Enable / disable UDP_GRO.

private static Set<ChannelOption<?>>
private static Set<ChannelOption<?>>
private IOException
Inherited from io.netty5.channel.epoll.AbstractEpollChannel:
checkResolvableclearFlagcloseTransportNowderegister0doClearScheduledReaddoConnect0doFinishConnectdoReaddoReadBytesdoReadNowdoWriteBytesdoWriteOrSendBytesepollInReadyepollOutReadyepollRdHupReadyfdfetchLocalAddressflagsisOpenisSoErrorZeroisWriteFlushedScheduledlocalAddress0newDirectBuffernewDirectBufferreadBufferAllocatorreadLoopCompleteregister0registrationremoteAddress0resetCachedAddressessetFlagwriteLoopComplete