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

public final Class EpollSocketChannel

extends AbstractEpollChannel<EpollServerSocketChannel>
implements SocketChannel
Class Inheritance
All Implemented Interfaces
io.netty5.channel.socket.SocketChannel, 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, .BufferAllocator, io.netty5.channel.AdaptiveReadHandleFactory, .ChannelException, .ChannelOption, .ChannelShutdownDirection, .DefaultFileRegion, .EventLoop, .FileRegion, .WriteHandleFactory, io.netty5.channel.socket.SocketChannel, .SocketChannelWriteHandleFactory, .SocketProtocolFamily, io.netty5.channel.unix.DomainSocketReadMode, .FileDescriptor, .IntegerUnixChannelOption, .IovArray, .PeerCredentials, .RawUnixChannelOption, .SocketWritableByteChannel, .UnixChannel, .UnixChannelOption, .UnixChannelUtil, io.netty5.util.Resource, io.netty5.util.concurrent.Future, .GlobalEventExecutor, io.netty5.util.internal.StringUtil, java.io.IOException, java.net.InetAddress, .ProtocolFamily, .SocketAddress, java.nio.ByteBuffer, java.nio.channels.NotYetConnectedException, .WritableByteChannel, java.util.Collection, .Collections, .Map, .Set, java.util.concurrent.Executor

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

Available options

In addition to the options provided by SocketChannel and UnixChannel, EpollSocketChannel allows the following options in the option map:
ChannelOption INET INET6 UNIX
IntegerUnixChannelOptionXXX
RawUnixChannelOptionXXX
EpollChannelOption#TCP_CORKXX-
EpollChannelOption#TCP_NOTSENT_LOWATXX-
EpollChannelOption#TCP_KEEPCNTXX-
EpollChannelOption#TCP_KEEPIDLEXX-
EpollChannelOption#TCP_KEEPINTVLXX-
EpollChannelOption#TCP_MD5SIGXX-
EpollChannelOption#TCP_QUICKACKXX-
EpollChannelOption#TCP_INFOXX-
ChannelOption#TCP_FASTOPEN_CONNECTXX-
EpollChannelOption#IP_TRANSPARENTXX-
EpollChannelOption#SO_BUSY_POLLXX-
UnixChannelOption#SO_PEERCREDX
UnixChannelOption#DOMAIN_SOCKET_READ_MODEX

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private WritableByteChannel
private static final String
private volatile DomainSocketReadMode
private static final Set<ChannelOption<?>>
private static final Set<ChannelOption<?>>
private volatile boolean
private volatile Collection<InetAddress>
Inherited from io.netty5.channel.epoll.AbstractEpollChannel:
activesocket

Constructor Summary

AccessConstructor and Description
public
public
EpollSocketChannel(EventLoop eventLoop, ProtocolFamily protocolFamily)

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

private
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected boolean
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

Returns:

if we should continue with writing more messages.
doWriteMultiple
(AbstractChannel<EpollServerSocketChannel, SocketAddress, SocketAddress>.WriteSink
the WriteSink used to track write results.
writeSink
)

Attempt to write multiple Buffer objects.

protected void
doWriteNow(AbstractChannel<EpollServerSocketChannel, 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.
private void

Returns:

if we should continue with writing more messages.
doWriteSingle
(AbstractChannel<EpollServerSocketChannel, SocketAddress, SocketAddress>.WriteSink
the WriteSink used to track write results.
writeSink
)

Attempt to write a single object.

private AbstractEpollChannel.ReadState
protected AbstractEpollChannel.ReadState
private AbstractEpollChannel.ReadState
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.
protected <T> T
private PeerCredentials
private DomainSocketReadMode
private int
private int
private int
getSoBusyPoll()

Get the SO_BUSY_POLL option on the socket.

private int
private EpollTcpInfo
getTcpInfo()

Updates and returns the TCP_INFO for the current socket.

private int
getTcpKeepCnt()

Get the TCP_KEEPCNT option on the socket.

private int
getTcpKeepIdle()

Get the TCP_KEEPIDLE option on the socket.

private int
getTcpKeepIntvl()

Get the TCP_KEEPINTVL option on the socket.

private long

Returns:

value is a uint32_t
getTcpNotSentLowAt
()

Get the TCP_NOTSENT_LOWAT option on the socket.

private int
getTcpUserTimeout()

Get the TCP_USER_TIMEOUT option on the socket.

private int
protected boolean
public boolean
isIpTransparent()

Returns true if IP_TRANSPARENT is enabled, false otherwise.

private boolean
private static boolean
private boolean
public boolean
isShutdown(ChannelShutdownDirection direction)

Implements io.netty5.channel.Channel.isShutdown.

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

Get the TCP_CORK option on the socket.

private boolean
isTcpFastOpenConnect()

Returns true if TCP fast open is enabled, false otherwise.

private boolean
private boolean
isTcpQuickAck()

Returns true if TCP_QUICKACK is enabled, false otherwise.

private static WriteHandleFactory
protected Future<Executor>
protected <T> void
private void
setIpTransparent(boolean transparent)

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

private void
setKeepAlive(boolean keepAlive)

private void
private void
setReceiveBufferSize(int receiveBufferSize)

private void
setReuseAddress(boolean reuseAddress)

private void
setSendBufferSize(int sendBufferSize)

private void
setSoBusyPoll(int loopMicros)

Set the SO_BUSY_POLL option on the socket.

private void
setSoLinger(int soLinger)

private void
setTcpCork(boolean tcpCork)

Set the TCP_CORK option on the socket.

private void
setTcpFastOpenConnect(boolean fastOpenConnect)

Enables client TCP fast open.

private void
setTcpKeepCnt(int probes)

Set the TCP_KEEPCNT option on the socket.

private void
setTcpKeepIdle(int seconds)

Set the TCP_KEEPIDLE option on the socket.

private void
setTcpKeepIntvl(int seconds)

Set the TCP_KEEPINTVL option on the socket.

private void
setTcpMd5Sig(Map<InetAddress, byte[]> keys)

Set the TCP_MD5SIG option on the socket.

private void
setTcpNoDelay(boolean tcpNoDelay)

private void
setTcpNotSentLowAt(long
is a uint32_t
tcpNotSentLowAt
)

Set the TCP_NOTSENT_LOWAT option on the socket.

private void
setTcpQuickAck(boolean quickAck)

Set the TCP_QUICKACK option on the socket.

private void
setTcpUserTimeout(int milliseconds)

Set the TCP_USER_TIMEOUT option on the socket.

private void
setTrafficClass(int trafficClass)

private static Set<ChannelOption<?>>
private static Set<ChannelOption<?>>
private void

Returns:

if we should continue with writing more messages.
writeBytes
(AbstractChannel<EpollServerSocketChannel, SocketAddress, SocketAddress>.WriteSink
the WriteSink used to track write results.
writeSink
)

Write bytes form the given Buffer to the underlying java.nio.channels.Channel.

private long

Returns:

if we should continue with writing more messages.
writeBytesMultiple
(IovArray
The array which contains the content to write.
array
)

Write multiple bytes via IovArray.

private long

Returns:

write result.
writeBytesMultiple
(ByteBuffer[]
The buffers to write.
nioBuffers
,
int
The number of buffers to write.
nioBufferCnt
,
long
The number of bytes we expect to write.
expectedWrittenBytes
,
long
The maximum number of bytes we should attempt to write.
maxBytesPerGatheringWrite
)

Write multiple bytes via ByteBuffer array.

private void

Returns:

if we should continue with writing more messages.
writeDefaultFileRegion
(AbstractChannel<EpollServerSocketChannel, SocketAddress, SocketAddress>.WriteSink
the WriteSink used to track write results.
writeSink
)

Write a DefaultFileRegion

private void

Returns:

if we should continue with writing more messages.
writeFileRegion
(AbstractChannel<EpollServerSocketChannel, SocketAddress, SocketAddress>.WriteSink
the WriteSink used to track write results.
writeSink
)

Write a FileRegion

Inherited from io.netty5.channel.epoll.AbstractEpollChannel:
checkResolvableclearFlagcloseTransportNowderegister0doBinddoClearScheduledReaddoClosedoConnectdoDisconnectdoFinishConnectdoReaddoReadBytesdoReadNowdoWriteBytesdoWriteOrSendBytesepollInReadyepollOutReadyepollRdHupReadyfdfetchLocalAddressflagsisActiveisOpenisSoErrorZeroisWriteFlushedScheduledlocalAddress0newDirectBuffernewDirectBufferreadBufferAllocatorreadLoopCompleteregister0registrationremoteAddress0resetCachedAddressessetFlagwriteLoopComplete