public abstract class Window extends AbstractLoggingBean implements ChannelHolder, 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 |
---|---|
protected Object |
lock |
log
Modifier | Constructor and Description |
---|---|
protected |
Window(Channel channel,
boolean isClient) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInitialized(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 Predicate<Window> |
largerThan(long minSize) |
String |
toString() |
protected void |
updateSize(long size) |
protected final Object lock
protected Window(Channel channel, boolean isClient)
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 IOException
IOException
protected void updateSize(long size)
protected void checkInitialized(String location)
public boolean isOpen()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.