public final class EpollSocketChannel extends AbstractEpollStreamChannel implements SocketChannel
SocketChannel implementation that uses linux EPOLL Edge-Triggered Mode for
maximal performance.| Modifier and Type | Class and Description |
|---|---|
private class |
EpollSocketChannel.EpollSocketChannelUnsafe |
AbstractEpollStreamChannel.EpollStreamUnsafe, AbstractEpollStreamChannel.SpliceInTaskAbstractEpollChannel.AbstractEpollUnsafeAbstractChannel.AbstractUnsafeChannel.Unsafe| Modifier and Type | Field and Description |
|---|---|
private EpollSocketChannelConfig |
config |
private java.net.InetSocketAddress |
local |
private java.net.InetSocketAddress |
remote |
private java.net.InetSocketAddress |
requestedRemote |
private java.util.Collection<java.net.InetAddress> |
tcpMd5SigAddresses |
active, epollInReadyRunnablePending, flags, inputClosedSeenErrorOnRead, socket| Constructor and Description |
|---|
EpollSocketChannel() |
EpollSocketChannel(Channel parent,
LinuxSocket fd,
java.net.InetSocketAddress remote) |
EpollSocketChannel(int fd) |
EpollSocketChannel(LinuxSocket fd,
boolean active) |
| Modifier and Type | Method and Description |
|---|---|
private static java.net.InetSocketAddress |
computeRemoteAddr(java.net.InetSocketAddress remoteAddr,
java.net.InetSocketAddress osRemoteAddr) |
EpollSocketChannelConfig |
config()
Returns the configuration of this channel.
|
protected void |
doBind(java.net.SocketAddress local)
Bind the
Channel to the SocketAddress |
protected boolean |
doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
Connect to the remote peer
|
java.net.InetSocketAddress |
localAddress()
Returns the local address where this channel is bound to.
|
protected java.net.SocketAddress |
localAddress0()
Returns the
SocketAddress which is bound locally. |
protected AbstractEpollChannel.AbstractEpollUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
ServerSocketChannel |
parent()
Returns the parent of this channel.
|
java.net.InetSocketAddress |
remoteAddress()
Returns the remote address where this channel is connected to.
|
protected java.net.SocketAddress |
remoteAddress0()
Return the
SocketAddress which the Channel is connected to. |
(package private) void |
setTcpMd5Sig(java.util.Map<java.net.InetAddress,byte[]> keys) |
EpollTcpInfo |
tcpInfo()
Returns the
TCP_INFO for the current socket. |
EpollTcpInfo |
tcpInfo(EpollTcpInfo info)
Updates and returns the
TCP_INFO for the current socket. |
doClose, doWrite, doWriteSingle, filterOutboundMessage, isInputShutdown, isOutputShutdown, isShutdown, metadata, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutput, spliceTo, spliceTo, spliceTo, spliceTocheckResolvable, clearEpollIn, clearFlag, doBeginRead, doDeregister, doDisconnect, doReadBytes, doRegister, doWriteBytes, fd, isActive, isAllowHalfClosure, isCompatible, isFlagSet, isOpen, isSoErrorZero, newDirectBuffer, newDirectBuffer, setFlag, shouldBreakEpollInReadyalloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitisInputShutdown, isOutputShutdown, isShutdown, shutdown, shutdown, shutdownInput, shutdownInput, shutdownOutput, shutdownOutputalloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, metadata, pipeline, read, unsafeattr, hasAttrbind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushprivate final EpollSocketChannelConfig config
private volatile java.net.InetSocketAddress local
private volatile java.net.InetSocketAddress remote
private java.net.InetSocketAddress requestedRemote
private volatile java.util.Collection<java.net.InetAddress> tcpMd5SigAddresses
EpollSocketChannel(Channel parent, LinuxSocket fd, java.net.InetSocketAddress remote)
public EpollSocketChannel()
public EpollSocketChannel(int fd)
EpollSocketChannel(LinuxSocket fd, boolean active)
public EpollTcpInfo tcpInfo()
TCP_INFO for the current socket. See man 7 tcp.public EpollTcpInfo tcpInfo(EpollTcpInfo info)
TCP_INFO for the current socket.
See man 7 tcp.public java.net.InetSocketAddress remoteAddress()
ChannelSocketAddress is supposed to be down-cast into more
concrete type such as InetSocketAddress to retrieve the detailed
information.remoteAddress in interface ChannelremoteAddress in interface SocketChannelremoteAddress in class AbstractChannelnull if this channel is not connected.
If this channel is not connected but it can receive messages
from arbitrary remote addresses (e.g. DatagramChannel,
use DefaultAddressedEnvelope.recipient() to determine
the origination of the received message as this method will
return null.public java.net.InetSocketAddress localAddress()
ChannelSocketAddress is supposed to be down-cast into more concrete
type such as InetSocketAddress to retrieve the detailed
information.localAddress in interface ChannellocalAddress in interface SocketChannellocalAddress in class AbstractChannelnull if this channel is not bound.protected java.net.SocketAddress localAddress0()
AbstractChannelSocketAddress which is bound locally.localAddress0 in class AbstractChannelprotected java.net.SocketAddress remoteAddress0()
AbstractChannelSocketAddress which the Channel is connected to.remoteAddress0 in class AbstractChannelprotected void doBind(java.net.SocketAddress local)
throws java.lang.Exception
AbstractChannelChannel to the SocketAddressdoBind in class AbstractChanneljava.lang.Exceptionpublic EpollSocketChannelConfig config()
Channelconfig in interface Channelconfig in interface SocketChannelconfig in class AbstractEpollChannelpublic ServerSocketChannel parent()
Channelparent in interface Channelparent in interface SocketChannelparent in class AbstractChannelnull if this channel does not have a parent channel.protected AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannelAbstractChannel.AbstractUnsafe instance which will be used for the life-time of the ChannelnewUnsafe in class AbstractEpollStreamChannelprivate static java.net.InetSocketAddress computeRemoteAddr(java.net.InetSocketAddress remoteAddr,
java.net.InetSocketAddress osRemoteAddr)
protected boolean doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
throws java.lang.Exception
AbstractEpollStreamChanneldoConnect in class AbstractEpollStreamChanneljava.lang.Exceptionvoid setTcpMd5Sig(java.util.Map<java.net.InetAddress,byte[]> keys)
throws java.io.IOException
java.io.IOException