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,NioSctpChannel,NioSctpServerChannel,NioServerDomainSocketChannel,NioServerSocketChannel
AbstractNioChannel base class for Channels that operate on messages.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.netty.channel.nio.AbstractNioChannel
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafeNested classes/interfaces inherited from class io.netty.channel.AbstractChannel
AbstractChannel.AbstractUnsafeNested 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
ConstructorsModifierConstructorDescriptionprotectedAbstractNioMessageChannel(Channel parent, SelectableChannel ch, int readInterestOp) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancloseOnReadError(Throwable cause) protected booleanReturnstrueif we should continue the write loop on a write error.protected booleancontinueReading(RecvByteBufAllocator.Handle allocHandle) protected voidSchedule a read operation.protected abstract intdoReadMessages(List<Object> buf) Read messages into the given array and return the amount which was read.protected voidFlush the content of the given buffer to the remote peer.protected abstract booleandoWriteMessage(Object msg, ChannelOutboundBuffer in) Write a message to the underlyingChannel.protected AbstractNioChannel.AbstractNioUnsafeCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannelMethods inherited from class io.netty.channel.nio.AbstractNioChannel
clearReadPending, doClose, doConnect, doDeregister, doFinishConnect, doRegister, eventLoop, isCompatible, isOpen, isReadPending, javaChannel, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafeMethods 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, writeAndFlushMethods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttrMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:AbstractChannelCreate a newAbstractChannel.AbstractUnsafeinstance which will be used for the life-time of theChannel- Specified by:
newUnsafein classAbstractChannel
-
doBeginRead
Description copied from class:AbstractChannelSchedule a read operation.- Overrides:
doBeginReadin classAbstractNioChannel- Throws:
Exception
-
continueReading
-
doWrite
Description copied from class:AbstractChannelFlush the content of the given buffer to the remote peer.- Specified by:
doWritein classAbstractChannel- Throws:
Exception
-
continueOnWriteError
protected boolean continueOnWriteError()Returnstrueif 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:
trueif and only if the message has been written- Throws:
Exception
-