public abstract class AbstractNioChannel extends AbstractChannel
Channel implementations which use a Selector based approach.| 限定符和类型 | 类和说明 |
|---|---|
protected class |
AbstractNioChannel.AbstractNioUnsafe |
static interface |
AbstractNioChannel.NioUnsafe
Special
Unsafe sub-type which allows to access the underlying SelectableChannel |
AbstractChannel.AbstractUnsafeChannel.Unsafe| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
readInterestOp |
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractNioChannel(Channel parent,
java.nio.channels.SelectableChannel ch,
int readInterestOp)
Create a new instance
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
clearReadPending()
Set read pending to
false. |
protected void |
doBeginRead()
Schedule a read operation.
|
protected void |
doClose()
Close the
Channel |
protected abstract boolean |
doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
Connect to the remote peer
|
protected void |
doDeregister()
|
protected abstract void |
doFinishConnect()
Finish the connect
|
protected void |
doRegister()
|
NioEventLoop |
eventLoop()
|
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 and may get active later |
protected boolean |
isReadPending()
已过时。
No longer supported.
No longer supported.
|
protected java.nio.channels.SelectableChannel |
javaChannel() |
protected ByteBuf |
newDirectBuffer(ByteBuf buf)
Returns an off-heap copy of the specified
ByteBuf, and releases the original one. |
protected ByteBuf |
newDirectBuffer(ReferenceCounted holder,
ByteBuf buf)
Returns an off-heap copy of the specified
ByteBuf, and releases the specified holder. |
protected java.nio.channels.SelectionKey |
selectionKey()
Return the current
SelectionKey |
protected void |
setReadPending(boolean readPending)
已过时。
Use
clearReadPending() if appropriate instead.
No longer supported. |
AbstractNioChannel.NioUnsafe |
unsafe()
Returns an internal-use-only object that provides unsafe operations.
|
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doDisconnect, doShutdownOutput, doWrite, equals, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, newUnsafe, parent, pipeline, read, remoteAddress, remoteAddress0, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrattr, hasAttrprotected AbstractNioChannel(Channel parent, java.nio.channels.SelectableChannel ch, int readInterestOp)
parent - the parent Channel by which this instance was created. May be nullch - the underlying SelectableChannel on which it operatesreadInterestOp - the ops to set to receive data from the SelectableChannelpublic boolean isOpen()
Channeltrue if the Channel is open and may get active laterpublic AbstractNioChannel.NioUnsafe unsafe()
Channelunsafe 在接口中 Channelunsafe 在类中 AbstractChannelprotected java.nio.channels.SelectableChannel javaChannel()
public NioEventLoop eventLoop()
ChanneleventLoop 在接口中 ChanneleventLoop 在类中 AbstractChannelprotected java.nio.channels.SelectionKey selectionKey()
SelectionKey@Deprecated protected boolean isReadPending()
@Deprecated protected void setReadPending(boolean readPending)
clearReadPending() if appropriate instead.
No longer supported.protected final void clearReadPending()
false.protected boolean isCompatible(EventLoop loop)
AbstractChanneltrue if the given EventLoop is compatible with this instance.isCompatible 在类中 AbstractChannelprotected void doRegister()
throws java.lang.Exception
AbstractChannelChannel is registered with its EventLoop as part of the register process.
Sub-classes may override this methoddoRegister 在类中 AbstractChanneljava.lang.Exceptionprotected void doDeregister()
throws java.lang.Exception
AbstractChanneldoDeregister 在类中 AbstractChanneljava.lang.Exceptionprotected void doBeginRead()
throws java.lang.Exception
AbstractChanneldoBeginRead 在类中 AbstractChanneljava.lang.Exceptionprotected abstract boolean doConnect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
throws java.lang.Exception
java.lang.Exceptionprotected abstract void doFinishConnect()
throws java.lang.Exception
java.lang.Exceptionprotected final ByteBuf newDirectBuffer(ReferenceCounted holder, ByteBuf buf)
ByteBuf, and releases the specified holder.
The caller must ensure that the holder releases the original ByteBuf when the holder is released by
this method. Note that this method does not create an off-heap copy if the allocation / deallocation cost is
too high, but just returns the original ByteBuf..protected void doClose()
throws java.lang.Exception
AbstractChannelChanneldoClose 在类中 AbstractChanneljava.lang.Exception