Class AbstractNioChannel

    • Field Detail

      • readInterestOp

        protected final int readInterestOp
      • readOps

        protected final NioIoOps readOps
    • Constructor Detail

      • AbstractNioChannel

        protected AbstractNioChannel​(Channel parent,
                                     java.nio.channels.SelectableChannel ch,
                                     int readOps)
        Create a new instance
        Parameters:
        parent - the parent Channel by which this instance was created. May be null
        ch - the underlying SelectableChannel on which it operates
        readOps - the ops to set to receive data from the SelectableChannel
      • AbstractNioChannel

        protected AbstractNioChannel​(Channel parent,
                                     java.nio.channels.SelectableChannel ch,
                                     NioIoOps readOps)
    • Method Detail

      • addAndSubmit

        protected void addAndSubmit​(NioIoOps addOps)
      • removeAndSubmit

        protected void removeAndSubmit​(NioIoOps removeOps)
      • isOpen

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

        protected java.nio.channels.SelectableChannel javaChannel()
      • selectionKey

        @Deprecated
        protected java.nio.channels.SelectionKey selectionKey()
        Deprecated.
        Return the current SelectionKey
      • isReadPending

        @Deprecated
        protected boolean isReadPending()
        Deprecated.
        No longer supported. No longer supported.
      • setReadPending

        @Deprecated
        protected void setReadPending​(boolean readPending)
        Deprecated.
        Use clearReadPending() if appropriate instead. No longer supported.
      • clearReadPending

        protected final void clearReadPending()
        Set read pending to false.
      • doBeginRead

        protected void doBeginRead()
                            throws java.lang.Exception
        Description copied from class: AbstractChannel
        Schedule a read operation.
        Specified by:
        doBeginRead in class AbstractChannel
        Throws:
        java.lang.Exception
      • doConnect

        protected abstract boolean doConnect​(java.net.SocketAddress remoteAddress,
                                             java.net.SocketAddress localAddress)
                                      throws java.lang.Exception
        Connect to the remote peer
        Throws:
        java.lang.Exception
      • doFinishConnect

        protected abstract void doFinishConnect()
                                         throws java.lang.Exception
        Finish the connect
        Throws:
        java.lang.Exception
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(ByteBuf buf)
        Returns an off-heap copy of the specified ByteBuf, and releases the original one. Note that this method does not create an off-heap copy if the allocation / deallocation cost is too high, but just returns the original ByteBuf..
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(ReferenceCounted holder,
                                                ByteBuf buf)
        Returns an off-heap copy of the specified ByteBuf, and releases the specified holder. The caller must ensure that the holder releases the original ByteBuf when the holder is released by this method. Note that this method does not create an off-heap copy if the allocation / deallocation cost is too high, but just returns the original ByteBuf..