public abstract class AbstractNioMessageChannel extends AbstractNioChannel
AbstractNioChannel Channel的基类,用于处理消息。
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafeAbstractChannel.AbstractUnsafeChannel.UnsafereadInterestOp| 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, unsafealloc, 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, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitattr, hasAttrprotected 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.