Class AbstractNioChannel

    • Field Detail

      • ch

        private final java.nio.channels.SelectableChannel ch
      • readInterestOp

        protected final int readInterestOp
      • selectionKey

        volatile java.nio.channels.SelectionKey selectionKey
      • readPending

        boolean readPending
      • clearReadPendingRunnable

        private final java.lang.Runnable clearReadPendingRunnable
      • connectPromise

        private ChannelPromise connectPromise
        The future of the current connection attempt. If not null, subsequent connection attempts will fail.
      • connectTimeoutFuture

        private java.util.concurrent.ScheduledFuture<?> connectTimeoutFuture
      • requestedRemoteAddress

        private java.net.SocketAddress requestedRemoteAddress
    • Constructor Detail

      • AbstractNioChannel

        protected AbstractNioChannel​(Channel parent,
                                     java.nio.channels.SelectableChannel ch,
                                     int readInterestOp)
        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
        readInterestOp - the ops to set to receive data from the SelectableChannel
    • Method Detail

      • 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

        protected java.nio.channels.SelectionKey selectionKey()
        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.
      • setReadPending0

        private void setReadPending0​(boolean readPending)
      • clearReadPending0

        private void clearReadPending0()
      • doRegister

        protected void doRegister()
                           throws java.lang.Exception
        Description copied from class: AbstractChannel
        Is called after the Channel is registered with its EventLoop as part of the register process. Sub-classes may override this method
        Overrides:
        doRegister in class AbstractChannel
        Throws:
        java.lang.Exception
      • 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..