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 |
(package private) boolean |
epollInReadyRunnablePending |
protected int |
flags |
(package private) boolean |
inputClosedSeenErrorOnRead |
private static ChannelMetadata |
METADATA |
private int |
readFlag |
(package private) LinuxSocket |
socket |
| Constructor and Description |
|---|
AbstractEpollChannel(Channel parent,
LinuxSocket fd,
int flag,
boolean active) |
AbstractEpollChannel(LinuxSocket 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) |
FileDescriptor |
fd()
Returns the
FileDescriptor that is used by this Channel. |
boolean |
isActive()
Return
true if the Channel is active and so connected. |
(package private) boolean |
isAllowHalfClosure(ChannelConfig config) |
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) |
(package private) boolean |
shouldBreakEpollInReady(ChannelConfig config) |
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doWrite, equals, eventLoop, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitalloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, localAddress, parent, pipeline, read, remoteAddress, unsafeattr, hasAttrbind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushprivate static final ChannelMetadata METADATA
private final int readFlag
final LinuxSocket socket
protected int flags
boolean inputClosedSeenErrorOnRead
boolean epollInReadyRunnablePending
protected volatile boolean active
AbstractEpollChannel(LinuxSocket fd, int flag)
AbstractEpollChannel(Channel parent, LinuxSocket fd, int flag, boolean active)
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 FileDescriptor 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 final void doBeginRead()
throws java.lang.Exception
AbstractChanneldoBeginRead in class AbstractChanneljava.lang.Exceptionfinal boolean shouldBreakEpollInReady(ChannelConfig config)
final boolean isAllowHalfClosure(ChannelConfig config)
final 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