public abstract class AbstractNioMessageChannel extends AbstractNioChannel
AbstractNioChannel
Channel
的基类,用于处理消息。
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
readInterestOp
Modifier | Constructor and Description |
---|---|
protected |
AbstractNioMessageChannel(Channel parent, java.nio.channels.SelectableChannel ch, int readInterestOp) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
closeOnReadError(java.lang.Throwable cause) |
protected boolean |
continueOnWriteError()
如果我们应该在写入错误时继续写入循环,则返回
true 。
|
protected void |
doBeginRead()
安排读取操作。
|
protected abstract int |
doReadMessages(java.util.List<java.lang.Object> buf)
将消息读入给定数组并返回读取的数量。
|
protected void |
doWrite(ChannelOutboundBuffer in)
将给定缓冲区的内容刷新到远程对等体。
|
protected abstract boolean |
doWriteMessage(java.lang.Object msg, ChannelOutboundBuffer in)
写下消息到底层
Channel 。
|
protected AbstractNioChannel.AbstractNioUnsafe |
newUnsafe()
创建一个新的 AbstractChannel.AbstractUnsafe 实例,该实例将用于Channel 的生命周期
|
clearReadPending, doClose, doConnect, doDeregister, doFinishConnect, doRegister, eventLoop, isCompatible, isOpen, isReadPending, javaChannel, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafe
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBind, doDisconnect, doShutdownOutput, equals, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, localAddress0, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, voidPromise, write, write, writeAndFlush, writeAndFlush
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attr, hasAttr
protected AbstractNioMessageChannel(Channel parent, java.nio.channels.SelectableChannel ch, int readInterestOp)
protected AbstractNioChannel.AbstractNioUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
实例,该实例将用于Channel
的生命周期
newUnsafe
在课堂
AbstractChannel
protected void doBeginRead() throws java.lang.Exception
AbstractChannel
doBeginRead
在课堂上
AbstractNioChannel
java.lang.Exception
protected void doWrite(ChannelOutboundBuffer in) throws java.lang.Exception
AbstractChannel
doWrite
AbstractChannel
java.lang.Exception
protected boolean continueOnWriteError()
true
。
protected boolean closeOnReadError(java.lang.Throwable cause)
protected abstract int doReadMessages(java.util.List<java.lang.Object> buf) throws java.lang.Exception
java.lang.Exception
protected abstract boolean doWriteMessage(java.lang.Object msg, ChannelOutboundBuffer in) throws java.lang.Exception
Channel
。
true
当且仅当消息已被写入
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.