abstract class AbstractEpollChannel extends AbstractChannel implements UnixChannel
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractEpollChannel.AbstractEpollUnsafe |
AbstractChannel.AbstractUnsafeChannel.Unsafe| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active |
private static ChannelMetadata |
DATA |
private Socket |
fileDescriptor |
protected int |
flags |
private int |
readFlag |
| Constructor and Description |
|---|
AbstractEpollChannel(Channel parent,
Socket fd,
int flag,
boolean active) |
AbstractEpollChannel(Socket fd,
int flag) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkResolvable(java.net.InetSocketAddress addr) |
(package private) void |
clearEpollIn() |
(package private) void |
clearFlag(int flag) |
abstract EpollChannelConfig |
config()
Returns the configuration of this channel.
|
protected void |
doBeginRead()
Schedule a read operation.
|
protected void |
doClose()
Close the
Channel |
protected void |
doDeregister()
|
protected void |
doDisconnect()
Disconnect this
Channel from its remote peer |
protected int |
doReadBytes(ByteBuf byteBuf)
Read bytes into the given
ByteBuf and return the amount. |
protected void |
doRegister()
|
protected int |
doWriteBytes(ByteBuf buf,
int writeSpinCount) |
Socket |
fd()
Returns the
FileDescriptor that is used by this Channel. |
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. |
(package private) boolean |
isFlagSet(int flag) |
boolean |
isOpen()
Returns
true if the Channel is open and may get active later |
(package private) static boolean |
isSoErrorZero(Socket fd) |
ChannelMetadata |
metadata()
|
private void |
modifyEvents() |
protected ByteBuf |
newDirectBuffer(ByteBuf buf)
Returns an off-heap copy of the specified
ByteBuf, and releases the original one. |
protected ByteBuf |
newDirectBuffer(java.lang.Object holder,
ByteBuf buf)
Returns an off-heap copy of the specified
ByteBuf, and releases the specified holder. |
private static ByteBuf |
newDirectBuffer0(java.lang.Object holder,
ByteBuf buf,
ByteBufAllocator alloc,
int capacity) |
protected abstract AbstractEpollChannel.AbstractEpollUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
(package private) void |
setFlag(int flag) |
alloc, bind, bind, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doWrite, equals, eventLoop, filterOutboundMessage, flush, hashCode, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newChannelPipeline, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattrclone, finalize, getClass, notify, notifyAll, wait, wait, waitalloc, bind, bind, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, isRegistered, isWritable, localAddress, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattrprivate static final ChannelMetadata DATA
private final int readFlag
private final Socket fileDescriptor
protected int flags
protected volatile boolean active
AbstractEpollChannel(Socket fd, int flag)
static boolean isSoErrorZero(Socket fd)
void setFlag(int flag)
throws java.io.IOException
java.io.IOExceptionvoid clearFlag(int flag)
throws java.io.IOException
java.io.IOExceptionboolean isFlagSet(int flag)
public final Socket fd()
UnixChannelFileDescriptor that is used by this Channel.fd in interface UnixChannelpublic abstract EpollChannelConfig config()
Channelpublic boolean isActive()
Channeltrue if the Channel is active and so connected.public ChannelMetadata metadata()
Channelprotected void doClose()
throws java.lang.Exception
AbstractChannelChanneldoClose in class AbstractChanneljava.lang.Exceptionprotected void doDisconnect()
throws java.lang.Exception
AbstractChannelChannel from its remote peerdoDisconnect in class AbstractChanneljava.lang.Exceptionprotected boolean isCompatible(EventLoop loop)
AbstractChanneltrue if the given EventLoop is compatible with this instance.isCompatible in class AbstractChannelpublic boolean isOpen()
Channeltrue if the Channel is open and may get active laterprotected void doDeregister()
throws java.lang.Exception
AbstractChanneldoDeregister in class AbstractChanneljava.lang.Exceptionprotected void doBeginRead()
throws java.lang.Exception
AbstractChanneldoBeginRead in class AbstractChanneljava.lang.Exceptionfinal void clearEpollIn()
private void modifyEvents()
throws java.io.IOException
java.io.IOExceptionprotected void doRegister()
throws java.lang.Exception
AbstractChannelChannel is registered with its EventLoop as part of the register process.
Sub-classes may override this methoddoRegister in class AbstractChanneljava.lang.Exceptionprotected abstract AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannelAbstractChannel.AbstractUnsafe instance which will be used for the life-time of the ChannelnewUnsafe in class AbstractChannelprotected final ByteBuf newDirectBuffer(ByteBuf buf)
ByteBuf, and releases the original one.private static ByteBuf newDirectBuffer0(java.lang.Object holder, ByteBuf buf, ByteBufAllocator alloc, int capacity)
protected static void checkResolvable(java.net.InetSocketAddress addr)
protected final int doReadBytes(ByteBuf byteBuf) throws java.lang.Exception
ByteBuf and return the amount.java.lang.Exceptionprotected final int doWriteBytes(ByteBuf buf, int writeSpinCount) throws java.lang.Exception
java.lang.Exception