Module io.netty5.transport
Package io.netty5.channel.nio
Class AbstractNioMessageChannel<P extends Channel,L extends SocketAddress,R extends SocketAddress>
- java.lang.Object
-
- io.netty5.util.DefaultAttributeMap
-
- io.netty5.channel.AbstractChannel<P,L,R>
-
- io.netty5.channel.nio.AbstractNioChannel<P,L,R>
-
- io.netty5.channel.nio.AbstractNioMessageChannel<P,L,R>
-
- All Implemented Interfaces:
Channel,ChannelOutboundInvoker,IoHandle,io.netty5.util.AttributeMap,io.netty5.util.concurrent.FuturePromiseFactory,Comparable<Channel>
- Direct Known Subclasses:
NioDatagramChannel,NioServerSocketChannel
public abstract class AbstractNioMessageChannel<P extends Channel,L extends SocketAddress,R extends SocketAddress> extends AbstractNioChannel<P,L,R>
AbstractNioChannelbase class forChannels that operate on messages.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.netty5.channel.AbstractChannel
AbstractChannel.DefaultAbstractChannelPipeline, AbstractChannel.ReadSink, AbstractChannel.WriteSink
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNioMessageChannel(P parent, EventLoop eventLoop, boolean supportingDisconnect, ReadHandleFactory defaultReadHandleFactory, WriteHandleFactory defaultWriteHandleFactory, SelectableChannel ch, int readInterestOp)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract intdoReadMessages(AbstractChannel.ReadSink readSink)Read messages into the given array and return the amount which was read.protected booleandoReadNow(AbstractChannel.ReadSink readSink)Try to read a message from the transport and dispatch it viaAbstractChannel.ReadSink.processRead(int, int, Object).-
Methods inherited from class io.netty5.channel.nio.AbstractNioChannel
doClearScheduledRead, doClose, doRead, isOpen, isWriteFlushedScheduled, javaChannel, newDirectBuffer, newDirectBuffer, selectionKey, writeLoopComplete
-
Methods inherited from class io.netty5.channel.AbstractChannel
bufferAllocator, cacheAddresses, closeFuture, closeTransport, compareTo, doBind, doConnect, doDisconnect, doFinishConnect, doShutdown, doWriteNow, equals, executor, filterOutboundMessage, finishConnect, getExtendedOption, getOption, hashCode, id, isConnectPending, isExtendedOptionSupported, isOptionSupported, isReadPending, isRegistered, isSupportingDisconnect, localAddress, localAddress0, newChannelPipeline, newSupportedIdentityOptionsSet, parent, pipeline, prepareToClose, readBufferAllocator, readHandle, readIfIsAutoRead, readLoopComplete, readNow, remoteAddress, remoteAddress0, setExtendedOption, setOption, shutdownReadSide, toString, validateEventLoopGroup, validateFileRegion, writableBytes, writeFlushed, writeFlushedNow, writeHandle
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.Channel
bind, close, connect, connect, deregister, disconnect, flush, isActive, isShutdown, isWritable, read, read, register, sendOutboundEvent, shutdown, write, writeAndFlush
-
Methods inherited from interface io.netty5.channel.ChannelOutboundInvoker
newFailedFuture, newPromise, newSucceededFuture, newSucceededFuture
-
-
-
-
Constructor Detail
-
AbstractNioMessageChannel
protected AbstractNioMessageChannel(P parent, EventLoop eventLoop, boolean supportingDisconnect, ReadHandleFactory defaultReadHandleFactory, WriteHandleFactory defaultWriteHandleFactory, SelectableChannel ch, int readInterestOp)
-
-
Method Detail
-
doReadNow
protected final boolean doReadNow(AbstractChannel.ReadSink readSink) throws Exception
Description copied from class:AbstractChannelTry to read a message from the transport and dispatch it viaAbstractChannel.ReadSink.processRead(int, int, Object). This method is called in a loop until there is nothing more messages to read or the channel was shutdown / closed. This method should never be called directly by sub-classes, useAbstractChannel.readNow()instead.- Specified by:
doReadNowin classAbstractChannel<P extends Channel,L extends SocketAddress,R extends SocketAddress>- Parameters:
readSink- theAbstractChannel.ReadSinkthat should be called with messages that are read from the transport to propagate these.- Returns:
trueif the channel should be shutdown / closed.- Throws:
Exception
-
doReadMessages
protected abstract int doReadMessages(AbstractChannel.ReadSink readSink) throws Exception
Read messages into the given array and return the amount which was read.- Throws:
Exception
-
-