public final class EpollServerSocketChannel extends AbstractChannel implements ServerSocketChannel
ServerSocketChannel
implementation that uses linux EPOLL Edge-Triggered Mode for
maximal performance.AbstractChannel.AbstractUnsafe
Channel.Unsafe
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
protected int |
flags |
Constructor and Description |
---|
EpollServerSocketChannel() |
Modifier and Type | Method and Description |
---|---|
protected static void |
checkResolvable(InetSocketAddress addr) |
protected void |
clearEpollOut() |
EpollServerSocketChannelConfig |
config()
Returns the configuration of this channel.
|
protected void |
doBeginRead()
Schedule a read operation.
|
protected void |
doBind(SocketAddress localAddress)
Bind the
Channel to the SocketAddress |
protected void |
doClose()
Close the
Channel |
protected void |
doDeregister()
|
protected void |
doDisconnect()
Disconnect this
Channel from its remote peer |
protected void |
doRegister()
|
protected void |
doWrite(ChannelOutboundBuffer in)
Flush the content of the given buffer to the remote peer.
|
boolean |
isActive()
Return
true if the Channel is active and so connected. |
protected boolean |
isCompatible(EventLoop loop)
Return
true if the given EventLoop is compatible with this instance. |
boolean |
isOpen()
Returns
true if the Channel is open an may get active later |
InetSocketAddress |
localAddress()
Returns the local address where this channel is bound to.
|
protected InetSocketAddress |
localAddress0()
Returns the
SocketAddress which is bound locally. |
ChannelMetadata |
metadata()
|
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
InetSocketAddress |
remoteAddress()
Returns the remote address where this channel is connected to.
|
protected InetSocketAddress |
remoteAddress0()
Return the
SocketAddress which the Channel is connected to. |
protected void |
setEpollOut() |
alloc, bind, bind, checkEOF, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, eventLoop, flush, hashCode, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
attr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
localAddress, remoteAddress
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
compareTo
protected boolean isCompatible(EventLoop loop)
AbstractChannel
true
if the given EventLoop
is compatible with this instance.protected void doBind(SocketAddress localAddress) throws Exception
AbstractChannel
Channel
to the SocketAddress
doBind
in class AbstractChannel
Exception
public EpollServerSocketChannelConfig config()
Channel
config
in interface Channel
config
in interface ServerSocketChannel
protected InetSocketAddress localAddress0()
AbstractChannel
SocketAddress
which is bound locally.localAddress0
in class AbstractChannel
protected InetSocketAddress remoteAddress0()
AbstractChannel
SocketAddress
which the Channel
is connected to.remoteAddress0
in class AbstractChannel
protected io.netty.channel.epoll.AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
instance which will be used for the life-time of the Channel
protected void doWrite(ChannelOutboundBuffer in)
AbstractChannel
doWrite
in class AbstractChannel
public boolean isActive()
Channel
true
if the Channel
is active and so connected.public ChannelMetadata metadata()
Channel
protected void doClose() throws Exception
AbstractChannel
Channel
doClose
in class AbstractChannel
Exception
public 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 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 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 class AbstractChannel
null
if this channel is not bound.protected void doDisconnect() throws Exception
AbstractChannel
Channel
from its remote peerdoDisconnect
in class AbstractChannel
Exception
public boolean isOpen()
Channel
true
if the Channel
is open an may get active laterprotected void doDeregister() throws Exception
AbstractChannel
doDeregister
in class AbstractChannel
Exception
protected void doBeginRead() throws Exception
AbstractChannel
doBeginRead
in class AbstractChannel
Exception
protected final void setEpollOut()
protected final void clearEpollOut()
protected void doRegister() throws Exception
AbstractChannel
Channel
is registered with its EventLoop
as part of the register process.
Sub-classes may override this methoddoRegister
in class AbstractChannel
Exception
protected static void checkResolvable(InetSocketAddress addr)
Copyright © 2008–2018 The Netty Project. All rights reserved.