| Modifier and Type | Class and Description |
|---|---|
| protected static class | ChannelAsyncOutputStream.
Marker type to avoid repeated buffering in
|
| protected static class | ChannelAsyncOutputStream.
Collects state variables; access is always synchronized on the single instance per stream. |
| Modifier and Type | Field and Description |
|---|---|
| private final Channel | |
| private final byte | |
| protected final AtomicReference | lastWrite
The future describing the last executed *buffer* write |
| private final Object | |
| private final ChannelStreamWriter | |
| protected final ChannelAsyncOutputStream. | writeState
Encapsulates the state of the current write operation. |
| Access | Constructor and Description |
|---|---|
| public | ChannelAsyncOutputStream(Channel
The channel, byte Channel through which the stream is communicatingEither cmd)SSH_MSG_CHANNEL_DATA or
SSH_MSG_CHANNEL_EXTENDED_DATA indicating the
output stream type
|
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| protected Buffer | |
| protected CloseFuture | |
| protected void | doCloseImmediately()
Overrides org. doCloseImmediately is called once and only once with state == Immediate Overriding methods should always call the base implementation. |
| protected void | |
| public Channel | |
| public byte | Returns: EitherSSH_MSG_CHANNEL_DATA or
SSH_MSG_CHANNEL_EXTENDED_DATA indicating the output
stream type
|
| public void | |
| protected void | |
| protected void | preClose()
Overrides org. preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. |
| protected void | |
| protected void | |
| public String | |
| public IoWriteFuture | writeBuffer(Buffer
the data to write buffer)Note the buffer must not be touched until the returned write future is completed. Implements org. Write the given buffer. |
| protected IoWriteFutureImpl | Returns: null if all written, or if the rest will be written via a future listener. Otherwise a
future for the remaining writes.IoWriteFutureImpl for the current writewhether being called in response to a remote window adjustment resume)Try to write as much of the current buffer as possible. |
| channelInstance | back to summary |
|---|---|
| private final Channel channelInstance | |
| cmd | back to summary |
|---|---|
| private final byte cmd | |
| lastWrite | back to summary |
|---|---|
| protected final AtomicReference<IoWriteFuture> lastWrite The future describing the last executed *buffer* write | |
| packetWriteId | back to summary |
|---|---|
| private final Object packetWriteId | |
| packetWriter | back to summary |
|---|---|
| private final ChannelStreamWriter packetWriter | |
| writeState | back to summary |
|---|---|
| protected final ChannelAsyncOutputStream. Encapsulates the state of the current write operation. Access is always under lock (on writeState's monitor), the lock is held only shortly and never while writing. | |
| ChannelAsyncOutputStream | back to summary |
|---|---|
public ChannelAsyncOutputStream(Channel channel, byte cmd)
| |
| abortWrite | back to summary |
|---|---|
| private boolean abortWrite(AbstractCloseable. | |
| createSendBuffer | back to summary |
|---|---|
| protected Buffer createSendBuffer(Buffer buffer, Channel channel, int length) | |
| doCloseGracefully | back to summary |
|---|---|
| protected CloseFuture doCloseGracefully() Overrides org.
| |
| doCloseImmediately | back to summary |
|---|---|
| protected void doCloseImmediately() Overrides org. Doc from org. doCloseImmediately is called once and only once with state == Immediate Overriding methods should always call the base implementation. It may be called concurrently while preClose() or doCloseGracefully is executing
| |
| doWriteIfPossible | back to summary |
|---|---|
| protected void doWriteIfPossible(boolean resume) | |
| getChannel | back to summary |
|---|---|
| public Channel getChannel() Implements org.
| |
| getCommandType | back to summary |
|---|---|
public byte getCommandType()
| |
| onWindowExpanded | back to summary |
|---|---|
| public void onWindowExpanded() throws IOException | |
| onWritten | back to summary |
|---|---|
| protected void onWritten(IoWriteFutureImpl future, int total, int length, IoWriteFuture f) | |
| preClose | back to summary |
|---|---|
| protected void preClose() Overrides org. Doc from org. preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true
| |
| shutdown | back to summary |
|---|---|
| protected void shutdown() | |
| terminateFuture | back to summary |
|---|---|
| protected void terminateFuture(IoWriteFutureImpl future) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| writeBuffer | back to summary |
|---|---|
| public IoWriteFuture writeBuffer(Buffer buffer) throws IOException Implements org. Doc from org. Write the given buffer.
This write operation is asynchronous: if there is not enough window space, it may keep the write pending
or write only part of the buffer and keep the rest pending. Concurrent writes are not allowed and will throw a
| |
| writePacket | back to summary |
|---|---|
| protected IoWriteFutureImpl writePacket(IoWriteFutureImpl future, boolean resume) Try to write as much of the current buffer as possible. If the buffer is larger than the packet size split it in packets, writing one after the other by chaining futures. If there is not enough window space, stop writing. Writing will be resumed once the window has been enlarged again.
| |
ChannelAsyncOutputStream#writePacket(IoWriteFutureImpl, boolean).
| Modifier and Type | Field and Description |
|---|---|
| protected boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| waitOnWindow | back to summary |
|---|---|
| protected boolean waitOnWindow | |
| BufferedFuture | back to summary |
|---|---|
| pack-priv BufferedFuture(Object id, Buffer buffer) | |
| Modifier and Type | Field and Description |
|---|---|
| protected AbstractCloseable. | openState
A copy of this stream's state as set by the superclass. |
| protected IoWriteFutureImpl | pendingWrite
The future describing the current packet write; if |
| protected int | toSend
Number of bytes still to send. |
| protected int | totalLength
Number of bytes to send in total. |
| protected boolean | windowExpanded
Set to true when there was a remote window expansion while
|
| protected boolean | writeInProgress
Flag to throw an exception if non-sequential |
| Access | Constructor and Description |
|---|---|
| protected |
| openState | back to summary |
|---|---|
| protected AbstractCloseable. A copy of this stream's state as set by the superclass. | |
| pendingWrite | back to summary |
|---|---|
| protected IoWriteFutureImpl pendingWrite The future describing the current packet write; if | |
| toSend | back to summary |
|---|---|
| protected int toSend Number of bytes still to send. | |
| totalLength | back to summary |
|---|---|
| protected int totalLength Number of bytes to send in total. | |
| windowExpanded | back to summary |
|---|---|
| protected boolean windowExpanded Set to true when there was a remote window expansion while
| |
| writeInProgress | back to summary |
|---|---|
| protected boolean writeInProgress Flag to throw an exception if non-sequential | |
| WriteState | back to summary |
|---|---|
| protected WriteState() | |