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, flags| Constructor and Description |
|---|
EpollSocketChannel() |
EpollSocketChannel(Channel parent,
Socket fd,
java.net.InetSocketAddress remote) |
EpollSocketChannel(FileDescriptor fd)
Deprecated.
|
EpollSocketChannel(Socket fd,
boolean active)
Creates a new
EpollSocketChannel from an existing FileDescriptor. |
| 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, shutdownOutput, shutdownOutput, shutdownOutput0, spliceTo, spliceTo, spliceTo, spliceTocheckResolvable, clearEpollIn, clearFlag, doBeginRead, doDeregister, doDisconnect, doReadBytes, doRegister, doWriteBytes, fd, isActive, isCompatible, isFlagSet, isOpen, isSoErrorZero, metadata, newDirectBuffer, newDirectBuffer, setFlagalloc, bind, bind, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, eventLoop, flush, hashCode, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newChannelPipeline, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattrclone, finalize, getClass, notify, notifyAll, wait, wait, waitisInputShutdown, isOutputShutdown, shutdownOutput, shutdownOutputalloc, bind, bind, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, isActive, isOpen, isRegistered, isWritable, metadata, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattrprivate 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
public EpollSocketChannel()
@Deprecated public EpollSocketChannel(FileDescriptor fd)
EpollSocketChannel(Socket, boolean).public EpollSocketChannel(Socket fd, boolean active)
EpollSocketChannel from an existing FileDescriptor.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