Class ChannelAsyncOutputStream

    • Constructor Detail

      • ChannelAsyncOutputStream

        public ChannelAsyncOutputStream​(Channel channel,
                                        byte cmd,
                                        boolean sendChunkIfRemoteWindowIsSmallerThanPacketSize)
        Parameters:
        channel - The Channel through which the stream is communicating
        cmd - Either SSH_MSG_CHANNEL_DATA or SSH_MSG_CHANNEL_EXTENDED_DATA indicating the output stream type
        sendChunkIfRemoteWindowIsSmallerThanPacketSize - Determines the chunking behaviour, if the remote window size is smaller than the packet size. Can be use to establish compatibility with certain clients, that wait until the window size is 0 before adjusting it.
        See Also:
        SSHD-1123
    • Method Detail

      • writeBuffer

        public IoWriteFuture writeBuffer​(Buffer buffer)
                                  throws IOException
        Description copied from interface: IoOutputStream
        Write the given buffer.
        Specified by:
        writeBuffer in interface IoOutputStream
        Parameters:
        buffer - the data to write. 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 data has actually been written.
        Throws:
        IOException - if an error occurred when writing the data
      • 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)
      • createSendBuffer

        protected Buffer createSendBuffer​(Buffer buffer,
                                          Channel channel,
                                          long length)
      • isSendChunkIfRemoteWindowIsSmallerThanPacketSize

        public boolean isSendChunkIfRemoteWindowIsSmallerThanPacketSize()
      • setSendChunkIfRemoteWindowIsSmallerThanPacketSize

        public void setSendChunkIfRemoteWindowIsSmallerThanPacketSize​(boolean sendChunkIfRemoteWindowIsSmallerThanPacketSize)