abstract class AbstractEpollChannel extends AbstractChannel implements UnixChannel
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractEpollChannel.AbstractEpollUnsafe |
AbstractChannel.AbstractUnsafe
Channel.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, 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, isRegistered, isWritable, localAddress, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
attr
private 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.IOException
void clearFlag(int flag) throws java.io.IOException
java.io.IOException
boolean isFlagSet(int flag)
public final Socket fd()
UnixChannel
FileDescriptor
that is used by this Channel
.fd
in interface UnixChannel
public abstract EpollChannelConfig config()
Channel
public boolean isActive()
Channel
true
if the Channel
is active and so connected.public ChannelMetadata metadata()
Channel
protected void doClose() throws java.lang.Exception
AbstractChannel
Channel
doClose
in class AbstractChannel
java.lang.Exception
protected void doDisconnect() throws java.lang.Exception
AbstractChannel
Channel
from its remote peerdoDisconnect
in class AbstractChannel
java.lang.Exception
protected boolean isCompatible(EventLoop loop)
AbstractChannel
true
if the given EventLoop
is compatible with this instance.isCompatible
in class AbstractChannel
public boolean isOpen()
Channel
true
if the Channel
is open and may get active laterprotected void doDeregister() throws java.lang.Exception
AbstractChannel
doDeregister
in class AbstractChannel
java.lang.Exception
protected void doBeginRead() throws java.lang.Exception
AbstractChannel
doBeginRead
in class AbstractChannel
java.lang.Exception
final void clearEpollIn()
private void modifyEvents() throws java.io.IOException
java.io.IOException
protected void doRegister() throws java.lang.Exception
AbstractChannel
Channel
is registered with its EventLoop
as part of the register process.
Sub-classes may override this methoddoRegister
in class AbstractChannel
java.lang.Exception
protected abstract AbstractEpollChannel.AbstractEpollUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
instance which will be used for the life-time of the Channel
newUnsafe
in class AbstractChannel
protected 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.Exception
protected final int doWriteBytes(ByteBuf buf, int writeSpinCount) throws java.lang.Exception
java.lang.Exception