public final class EpollServerSocketChannel extends AbstractEpollServerChannel implements ServerSocketChannel
ServerSocketChannel
implementation that uses linux EPOLL Edge-Triggered Mode for
maximal performance.AbstractEpollServerChannel.EpollServerSocketUnsafe
AbstractEpollChannel.AbstractEpollUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
Modifier and Type | Field and Description |
---|---|
private EpollServerSocketChannelConfig |
config |
private java.net.InetSocketAddress |
local |
private java.util.Collection<java.net.InetAddress> |
tcpMd5SigAddresses |
active, flags
Constructor and Description |
---|
EpollServerSocketChannel() |
EpollServerSocketChannel(FileDescriptor fd)
Deprecated.
Use
EpollServerSocketChannel(Socket, boolean) .
Creates a new EpollServerSocketChannel from an existing FileDescriptor . |
EpollServerSocketChannel(Socket fd)
Deprecated.
Use
EpollServerSocketChannel(Socket, boolean) .
Creates a new EpollServerSocketChannel from an existing Socket . |
EpollServerSocketChannel(Socket fd,
boolean active) |
Modifier and Type | Method and Description |
---|---|
EpollServerSocketChannelConfig |
config()
Returns the configuration of this channel.
|
protected void |
doBind(java.net.SocketAddress localAddress)
Bind the
Channel to the SocketAddress |
protected boolean |
isCompatible(EventLoop loop)
Return
true if the given EventLoop is compatible with this instance. |
java.net.InetSocketAddress |
localAddress()
Returns the local address where this channel is bound to.
|
protected java.net.InetSocketAddress |
localAddress0()
Returns the
SocketAddress which is bound locally. |
protected Channel |
newChildChannel(int fd,
byte[] address,
int offset,
int len) |
java.net.InetSocketAddress |
remoteAddress()
Returns the remote address where this channel is connected to.
|
(package private) void |
setTcpMd5Sig(java.util.Map<java.net.InetAddress,byte[]> keys) |
(package private) java.util.Collection<java.net.InetAddress> |
tcpMd5SigAddresses() |
doWrite, filterOutboundMessage, newUnsafe, remoteAddress0
checkResolvable, clearEpollIn, clearFlag, doBeginRead, doClose, doDeregister, doDisconnect, doReadBytes, doRegister, doWriteBytes, fd, isActive, isFlagSet, isOpen, isSoErrorZero, metadata, newDirectBuffer, newDirectBuffer, setFlag
alloc, 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, parent, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
attr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alloc, bind, bind, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, isActive, isOpen, isRegistered, isWritable, metadata, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
attr
private final EpollServerSocketChannelConfig config
private volatile java.net.InetSocketAddress local
private volatile java.util.Collection<java.net.InetAddress> tcpMd5SigAddresses
public EpollServerSocketChannel()
@Deprecated public EpollServerSocketChannel(FileDescriptor fd)
EpollServerSocketChannel(Socket, boolean)
.
Creates a new EpollServerSocketChannel
from an existing FileDescriptor
.@Deprecated public EpollServerSocketChannel(Socket fd)
EpollServerSocketChannel(Socket, boolean)
.
Creates a new EpollServerSocketChannel
from an existing Socket
.public EpollServerSocketChannel(Socket fd, boolean active)
protected boolean isCompatible(EventLoop loop)
AbstractChannel
true
if the given EventLoop
is compatible with this instance.isCompatible
in class AbstractEpollServerChannel
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.Exception
AbstractChannel
Channel
to the SocketAddress
doBind
in class AbstractChannel
java.lang.Exception
public java.net.InetSocketAddress remoteAddress()
Channel
SocketAddress
is supposed to be down-cast into more
concrete type such as InetSocketAddress
to retrieve the detailed
information.remoteAddress
in interface Channel
remoteAddress
in interface ServerSocketChannel
remoteAddress
in class AbstractChannel
null
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()
Channel
SocketAddress
is supposed to be down-cast into more concrete
type such as InetSocketAddress
to retrieve the detailed
information.localAddress
in interface Channel
localAddress
in interface ServerSocketChannel
localAddress
in class AbstractChannel
null
if this channel is not bound.public EpollServerSocketChannelConfig config()
Channel
config
in interface Channel
config
in interface ServerSocketChannel
config
in class AbstractEpollChannel
protected java.net.InetSocketAddress localAddress0()
AbstractChannel
SocketAddress
which is bound locally.localAddress0
in class AbstractChannel
protected Channel newChildChannel(int fd, byte[] address, int offset, int len) throws java.lang.Exception
newChildChannel
in class AbstractEpollServerChannel
java.lang.Exception
java.util.Collection<java.net.InetAddress> tcpMd5SigAddresses()
void setTcpMd5Sig(java.util.Map<java.net.InetAddress,byte[]> keys) throws java.io.IOException
java.io.IOException