Class AbstractNioChannel

    • Field Detail

      • ch

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

        protected final int readInterestOp
      • readOps

        protected final NioIoOps readOps
      • 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 Future<?> connectTimeoutFuture
      • requestedRemoteAddress

        private java.net.SocketAddress requestedRemoteAddress
    • 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.
      • setReadPending0

        private void setReadPending0​(boolean readPending)
      • clearReadPending0

        private void clearReadPending0()
      • 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..