Package org.apache.sshd.common.channel
Class Window
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.channel.Window
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ChannelHolder
- Direct Known Subclasses:
LocalWindow,RemoteWindow
public abstract class Window extends AbstractLoggingBean implements ChannelHolder, Closeable
AChannelimplements 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.- Author:
- Apache MINA SSHD Project
- See Also:
LocalWindow,RemoteWindow
-
-
Field Summary
Fields Modifier and Type Field Description protected Objectlock-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckInitialized(String location)voidclose()abstract voidconsume(long len)ChannelgetChannel()longgetMaxSize()longgetPacketSize()longgetSize()protected voidinit(long size, long packetSize, PropertyResolver resolver)booleanisOpen()protected static Predicate<Window>largerThan(long minSize)StringtoString()protected voidupdateSize(long size)
-
-
-
Field Detail
-
lock
protected final Object lock
-
-
Constructor Detail
-
Window
protected Window(Channel channel, boolean isClient)
-
-
Method Detail
-
getChannel
public Channel getChannel()
- Specified by:
getChannelin interfaceChannelHolder- Returns:
- The associated
Channelinstance
-
getSize
public long getSize()
-
getMaxSize
public long getMaxSize()
-
getPacketSize
public long getPacketSize()
-
init
protected void init(long size, long packetSize, PropertyResolver resolver)
-
consume
public abstract void consume(long len) throws IOException- Throws:
IOException
-
updateSize
protected void updateSize(long size)
-
checkInitialized
protected void checkInitialized(String location)
-
isOpen
public boolean isOpen()
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-