Top Description Constructors Methods
io.netty5.channel.nio

public abstract Class AbstractNioMessageChannel<P extends Channel, L extends SocketAddress, R extends SocketAddress>

extends AbstractNioChannel<P extends Channel, L extends SocketAddress, R extends SocketAddress>
Class Inheritance
Known Direct Subclasses
io.netty5.channel.socket.nio.NioDatagramChannel, io.netty5.channel.socket.nio.NioServerSocketChannel
Imports
io.netty5.channel.Channel, .ChannelShutdownDirection, .EventLoop, .ReadHandleFactory, .WriteHandleFactory, java.net.SocketAddress, java.nio.channels.SelectableChannel

AbstractNioChannel base class for Channels that operate on messages.

Constructor Summary

AccessConstructor and Description
protected
AbstractNioMessageChannel(P parent, EventLoop eventLoop, boolean supportingDisconnect, ReadHandleFactory defaultReadHandleFactory, WriteHandleFactory defaultWriteHandleFactory, SelectableChannel ch, int readInterestOp)

Method Summary

Modifier and TypeMethod and Description
protected abstract int
doReadMessages(AbstractChannel<P, L, R>.ReadSink readSink)

Read messages into the given array and return the amount which was read.

protected final boolean
doReadNow(AbstractChannel<P, L, R>.ReadSink
the ReadSink that should be called with messages that are read from the transport to propagate these.
readSink
)

Implements abstract io.netty5.channel.AbstractChannel.doReadNow.

Try to read a message from the transport and dispatch it via ReadSink#processRead(int, int, Object).
Inherited from io.netty5.channel.nio.AbstractNioChannel:
doClearScheduledReaddoClosedoReadisOpenisWriteFlushedScheduledjavaChannelnewDirectBuffernewDirectBuffernioProcessorselectionKeywriteLoopComplete

Constructor Detail

AbstractNioMessageChannelback to summary
protected AbstractNioMessageChannel(P parent, EventLoop eventLoop, boolean supportingDisconnect, ReadHandleFactory defaultReadHandleFactory, WriteHandleFactory defaultWriteHandleFactory, SelectableChannel ch, int readInterestOp)
See Also
AbstractNioChannel#AbstractNioChannel(Channel, EventLoop, boolean, ReadHandleFactory, WriteHandleFactory , SelectableChannel, int)

Method Detail

doReadMessagesback to summary
protected abstract int doReadMessages(AbstractChannel<P, L, R>.ReadSink readSink) throws Exception

Read messages into the given array and return the amount which was read.

doReadNowback to summary
protected final boolean doReadNow(AbstractChannel<P, L, R>.ReadSink readSink) throws Exception

Implements abstract io.netty5.channel.AbstractChannel.doReadNow.

Doc from io.netty5.channel.AbstractChannel.doReadNow.

Try to read a message from the transport and dispatch it via 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, use readNow() instead.

Parameters
readSink:AbstractChannel<P, L, R>.ReadSink

the ReadSink that should be called with messages that are read from the transport to propagate these.

Returns:boolean

true if the channel should be shutdown / closed.

Annotations
@Override