Class ChannelAsyncOutputStream

    • Constructor Detail

      • ChannelAsyncOutputStream

        public ChannelAsyncOutputStream​(Channel channel,
                                        byte cmd)
    • Method Detail

      • writePacket

        public IoWriteFuture writePacket​(Buffer buffer)
                                  throws IOException
        Description copied from interface: PacketWriter
        Encode and send the given buffer. Note: for session packets the buffer has to have 5 bytes free at the beginning to allow the encoding to take place. Also, the write position of the buffer has to be set to the position of the last byte to write.
        Specified by:
        writePacket in interface PacketWriter
        Parameters:
        buffer - the buffer to encode and send. NOTE: the buffer must not be touched until the returned write future is completed.
        Returns:
        An IoWriteFuture that can be used to check when the packet has actually been sent
        Throws:
        IOException - if an error occurred when encoding sending the packet
      • preClose

        protected void preClose()
        Description copied from class: AbstractCloseable
        preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true
        Overrides:
        preClose in class AbstractCloseable
      • doWriteIfPossible

        protected void doWriteIfPossible​(boolean resume)