Package io.netty.channel.nio
Class AbstractNioMessageChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.nio.AbstractNioChannel
io.netty.channel.nio.AbstractNioMessageChannel
- All Implemented Interfaces:
Channel
,ChannelOutboundInvoker
,AttributeMap
,Comparable<Channel>
- Direct Known Subclasses:
NioDatagramChannel
,NioServerSocketChannel
AbstractNioChannel
base class for Channel
s that operate on messages.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.netty.channel.nio.AbstractNioChannel
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafe
Nested classes/interfaces inherited from class io.netty.channel.AbstractChannel
AbstractChannel.AbstractUnsafe
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
Field Summary
FieldsFields inherited from class io.netty.channel.nio.AbstractNioChannel
readInterestOp, readPending, selectionKey
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractNioMessageChannel
(Channel parent, SelectableChannel ch, int readInterestOp) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
closeOnReadError
(Throwable cause) protected boolean
Returnstrue
if we should continue the write loop on a write error.protected boolean
continueReading
(RecvByteBufAllocator.Handle allocHandle) protected void
Schedule a read operation.protected abstract int
doReadMessages
(List<Object> buf) Read messages into the given array and return the amount which was read.protected void
Flush the content of the given buffer to the remote peer.protected abstract boolean
doWriteMessage
(Object msg, ChannelOutboundBuffer in) Write a message to the underlyingChannel
.protected AbstractNioChannel.AbstractNioUnsafe
Create a newAbstractChannel.AbstractUnsafe
instance which will be used for the life-time of theChannel
Methods inherited from class io.netty.channel.nio.AbstractNioChannel
clearReadPending, doClose, doConnect, doDeregister, doFinishConnect, doRegister, eventLoop, isCompatible, isOpen, isReadPending, javaChannel, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafe
Methods inherited from class io.netty.channel.AbstractChannel
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, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, remoteAddress0, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
Methods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttr
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.netty.util.AttributeMap
attr, hasAttr
-
Field Details
-
inputShutdown
boolean inputShutdown
-
-
Constructor Details
-
AbstractNioMessageChannel
- See Also:
-
-
Method Details
-
newUnsafe
Description copied from class:AbstractChannel
Create a newAbstractChannel.AbstractUnsafe
instance which will be used for the life-time of theChannel
- Specified by:
newUnsafe
in classAbstractChannel
-
doBeginRead
Description copied from class:AbstractChannel
Schedule a read operation.- Overrides:
doBeginRead
in classAbstractNioChannel
- Throws:
Exception
-
continueReading
-
doWrite
Description copied from class:AbstractChannel
Flush the content of the given buffer to the remote peer.- Specified by:
doWrite
in classAbstractChannel
- Throws:
Exception
-
continueOnWriteError
protected boolean continueOnWriteError()Returnstrue
if we should continue the write loop on a write error. -
closeOnReadError
-
doReadMessages
Read messages into the given array and return the amount which was read.- Throws:
Exception
-
doWriteMessage
Write a message to the underlyingChannel
.- Returns:
true
if and only if the message has been written- Throws:
Exception
-