public abstract class Window extends AbstractLoggingBean implements ChannelHolder, java.io.Closeable
Channel
implements a sliding window flow control for data packets (SSH_MSG_CHANNEL_DATA and
SSH_MSG_CHANNEL_EXTENDED_DATA packets). Each channel has two windows, a local window describing how much data it is
prepared to receive (and the peer is allowed to send), and a remote window that reflects this side's view of the
peer's local window. When the local window size is zero, no data should be received; when the remote window size is
zero, no data should be sent. Peers update the other's remote window periodically, but at the latest when a window is
exhausted, by sending SSH_MSG_CHANNEL_WINDOW_ADJUST messages.LocalWindow
,
RemoteWindow
Modifier and Type | Field and Description |
---|---|
private Channel |
channelInstance |
private java.util.concurrent.atomic.AtomicBoolean |
closed |
private java.util.concurrent.atomic.AtomicBoolean |
initialized |
protected java.lang.Object |
lock |
private long |
maxSize |
private long |
packetSize |
private long |
size |
private java.lang.String |
suffix |
log
Modifier | Constructor and Description |
---|---|
protected |
Window(Channel channel,
boolean isClient) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInitialized(java.lang.String location) |
void |
close() |
abstract void |
consume(long len) |
Channel |
getChannel() |
long |
getMaxSize() |
long |
getPacketSize() |
long |
getSize() |
protected void |
init(long size,
long packetSize,
PropertyResolver resolver) |
boolean |
isOpen() |
protected static java.util.function.Predicate<Window> |
largerThan(long minSize) |
java.lang.String |
toString() |
protected void |
updateSize(long size) |
protected final java.lang.Object lock
private final java.util.concurrent.atomic.AtomicBoolean closed
private final java.util.concurrent.atomic.AtomicBoolean initialized
private final Channel channelInstance
private final java.lang.String suffix
private long size
private long maxSize
private long packetSize
protected Window(Channel channel, boolean isClient)
protected static java.util.function.Predicate<Window> largerThan(long minSize)
public Channel getChannel()
getChannel
in interface ChannelHolder
Channel
instancepublic long getSize()
public long getMaxSize()
public long getPacketSize()
protected void init(long size, long packetSize, PropertyResolver resolver)
public abstract void consume(long len) throws java.io.IOException
java.io.IOException
protected void updateSize(long size)
protected void checkInitialized(java.lang.String location)
public boolean isOpen()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object