Class AbstractKQueueStreamChannel

    • Field Detail

      • active

        protected volatile boolean active
    • Method Detail

      • doWriteSingle

        protected int doWriteSingle​(ChannelOutboundBuffer in)
                             throws java.lang.Exception
        Attempt to write a single object.
        Parameters:
        in - the collection which contains objects to write.
        Returns:
        The value that should be decremented from the write quantum which starts at ChannelConfig.getWriteSpinCount(). The typical use cases are as follows:
        • 0 - if no write was attempted. This is appropriate if an empty ByteBuf (or other empty content) is encountered
        • 1 - if a single call to write data was made to the OS
        • ChannelUtils.WRITE_STATUS_SNDBUF_FULL - if an attempt to write data was made to the OS, but no data was accepted
        Throws:
        java.lang.Exception - If an I/O error occurs.
      • doShutdownOutput

        @UnstableApi
        protected final void doShutdownOutput()
                                       throws java.lang.Exception
        Description copied from class: AbstractChannel
        Called when conditions justify shutting down the output portion of the channel. This may happen if a write operation throws an exception.
        Overrides:
        doShutdownOutput in class AbstractChannel
        Throws:
        java.lang.Exception
      • isOutputShutdown

        public boolean isOutputShutdown()
        Specified by:
        isOutputShutdown in interface DuplexChannel
        See Also:
        Socket.isOutputShutdown()
      • isInputShutdown

        public boolean isInputShutdown()
        Description copied from interface: DuplexChannel
        Returns true if and only if the remote peer shut down its output so that no more data is received from this channel. Note that the semantic of this method is different from that of Socket.shutdownInput() and Socket.isInputShutdown().
        Specified by:
        isInputShutdown in interface DuplexChannel
      • isShutdown

        public boolean isShutdown()
        Description copied from interface: DuplexChannel
        Determine if both the input and output of this channel have been shutdown.
        Specified by:
        isShutdown in interface DuplexChannel
      • shutdown

        public ChannelFuture shutdown()
        Description copied from interface: DuplexChannel
        Will shutdown the input and output sides of this channel.
        Specified by:
        shutdown in interface DuplexChannel
        Returns:
        will be completed when both shutdown operations complete.
      • shutdown

        public ChannelFuture shutdown​(ChannelPromise promise)
        Description copied from interface: DuplexChannel
        Will shutdown the input and output sides of this channel.
        Specified by:
        shutdown in interface DuplexChannel
        Parameters:
        promise - will be completed when both shutdown operations complete.
        Returns:
        will be completed when both shutdown operations complete.
      • isActive

        public boolean isActive()
        Description copied from interface: Channel
        Return true if the Channel is active and so connected.
        Specified by:
        isActive in interface Channel
      • doDisconnect

        protected void doDisconnect()
                             throws java.lang.Exception
        Description copied from class: AbstractChannel
        Disconnect this Channel from its remote peer
        Specified by:
        doDisconnect in class AbstractChannel
        Throws:
        java.lang.Exception
      • isOpen

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

        protected final 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
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(ByteBuf buf)
        Returns an off-heap copy of the specified ByteBuf, and releases the original one.
      • newDirectBuffer

        protected final ByteBuf newDirectBuffer​(java.lang.Object 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.
      • checkResolvable

        protected static void checkResolvable​(java.net.InetSocketAddress addr)
      • doReadBytes

        protected final int doReadBytes​(ByteBuf byteBuf)
                                 throws java.lang.Exception
        Read bytes into the given ByteBuf and return the amount.
        Throws:
        java.lang.Exception
      • doWriteBytes

        protected final int doWriteBytes​(ChannelOutboundBuffer in,
                                         ByteBuf buf)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doBind

        protected void doBind​(java.net.SocketAddress local)
                       throws java.lang.Exception
        Description copied from class: AbstractChannel
        Bind the Channel to the SocketAddress
        Specified by:
        doBind in class AbstractChannel
        Throws:
        java.lang.Exception
      • doConnect

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

        protected boolean doConnect0​(java.net.SocketAddress remoteAddress,
                                     java.net.SocketAddress localAddress)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • localAddress0

        protected java.net.SocketAddress localAddress0()
        Description copied from class: AbstractChannel
        Returns the SocketAddress which is bound locally.
        Specified by:
        localAddress0 in class AbstractChannel