Class AbstractNioChannel<P extends Channel,​L extends SocketAddress,​R extends SocketAddress>

    • Constructor Detail

      • AbstractNioChannel

        protected AbstractNioChannel​(P parent,
                                     EventLoop eventLoop,
                                     boolean supportingDisconnect,
                                     ReadHandleFactory defaultReadHandleFactory,
                                     WriteHandleFactory defaultWriteHandleFactory,
                                     SelectableChannel ch,
                                     int readInterestOp)
        Create a new instance
        Parameters:
        parent - the parent Channel by which this instance was created. May be null
        eventLoop - the EventLoop to use for all I/O.
        supportingDisconnect - true if and only if the channel has the disconnect() operation that allows a user to disconnect and then call {
    • Method Detail

      • isOpen

        public final boolean isOpen()
        Description copied from interface: Channel
        Returns true if the Channel is open and may get active later
      • selectionKey

        protected final SelectionKey selectionKey()
        Return the current SelectionKey or null if the underlying channel was not registered with the Selector yet.
      • newDirectBuffer

        protected final io.netty5.buffer.Buffer newDirectBuffer​(io.netty5.buffer.Buffer buf)
        Allocates a new off-heap copy of the given buffer, unless the cost of doing so is too high. The given buffer is closed if a copy is created, or returned directly.
        Parameters:
        buf - The buffer to copy.
        Returns:
        Probably an off-heap copy of the given buffer.
      • newDirectBuffer

        protected final io.netty5.buffer.Buffer newDirectBuffer​(io.netty5.util.Resource<?> holder,
                                                                io.netty5.buffer.Buffer buf)
        Allocates a new off-heap copy of the given buffer, unless the cost of doing so is too high. The given holder is closed regardless.
        Parameters:
        buf - The buffer to copy.
        Returns:
        Probably an off-heap copy of the given buffer.
      • writeLoopComplete

        protected final void writeLoopComplete​(boolean allWritten)
        Description copied from class: AbstractChannel
        Called once the write loop completed. Subclasses might override this method for custom logic but should also call super.
        Overrides:
        writeLoopComplete in class AbstractChannel<P extends Channel,​L extends SocketAddress,​R extends SocketAddress>
        Parameters:
        allWritten - true if all messages were written during the write loop, false otherwise.