public abstract class AbstractNioChannel extends AbstractChannel
Channel
实现的抽象基类,它使用基于选择器的方法。
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractNioChannel.AbstractNioUnsafe |
static interface |
AbstractNioChannel.NioUnsafe
特殊
Unsafe 子类型,允许访问底层
SelectableChannel
|
AbstractChannel.AbstractUnsafe
Channel.Unsafe
Modifier and Type | Field and Description |
---|---|
protected int |
readInterestOp |
Modifier | Constructor and Description |
---|---|
protected |
AbstractNioChannel(Channel parent, java.nio.channels.SelectableChannel ch, int readInterestOp)
创建一个新的实例
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearReadPending()
将读取等待设置为
false 。
|
protected void |
doBeginRead()
安排读取操作。
|
protected void |
doClose()
关闭 Channel
|
protected abstract boolean |
doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
连接到远程对等
|
protected void |
doDeregister()
|
protected abstract void |
doFinishConnect()
完成连接
|
protected void |
doRegister()
|
NioEventLoop |
eventLoop()
|
protected boolean |
isCompatible(EventLoop loop)
如果给定的 EventLoop 与此实例兼容,则返回true 。
|
boolean |
isOpen()
如果 Channel 已打开并且稍后可能会激活,则返回true
|
protected boolean |
isReadPending()
已过时。
不再支持。
不再支持。
|
protected java.nio.channels.SelectableChannel |
javaChannel() |
protected ByteBuf |
newDirectBuffer(ByteBuf buf)
返回指定 ByteBuf 的堆外副本,并释放原始副本。
|
protected ByteBuf |
newDirectBuffer(ReferenceCounted holder, ByteBuf buf)
返回指定的 ByteBuf 的堆外副本,并释放指定的持有者。
|
protected java.nio.channels.SelectionKey |
selectionKey()
返回当前
SelectionKey
|
protected void |
setReadPending(boolean readPending)
已过时。
如果合适,请使用
clearReadPending() 。
不再支持。
|
AbstractNioChannel.NioUnsafe |
unsafe()
返回提供不安全操作
的仅供内部使用的对象。
|
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, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, newUnsafe, parent, pipeline, read, remoteAddress, remoteAddress0, toString, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attr, hasAttr
public AbstractNioChannel.NioUnsafe unsafe()
Channel
unsafe
在界面
Channel
unsafe
在课堂
AbstractChannel
protected java.nio.channels.SelectableChannel javaChannel()
public NioEventLoop eventLoop()
Channel
eventLoop
,界面
Channel
eventLoop
在课堂上
AbstractChannel
protected java.nio.channels.SelectionKey selectionKey()
SelectionKey
@Deprecated protected boolean isReadPending()
@Deprecated protected void setReadPending(boolean readPending)
protected final void clearReadPending()
false
。
protected boolean isCompatible(EventLoop loop)
AbstractChannel
EventLoop
与此实例兼容,则返回true
。
isCompatible
在课堂上
AbstractChannel
protected void doRegister() throws java.lang.Exception
AbstractChannel
doRegister
在课堂上
AbstractChannel
java.lang.Exception
protected void doDeregister() throws java.lang.Exception
AbstractChannel
doDeregister
AbstractChannel
java.lang.Exception
protected void doBeginRead() throws java.lang.Exception
AbstractChannel
doBeginRead
在课堂上
AbstractChannel
java.lang.Exception
protected abstract boolean doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
java.lang.Exception
protected abstract void doFinishConnect() throws java.lang.Exception
java.lang.Exception
protected final ByteBuf newDirectBuffer(ReferenceCounted holder, ByteBuf buf)
protected void doClose() throws java.lang.Exception
AbstractChannel
Channel
doClose
在课堂上
AbstractChannel
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.