Class LocalWindow
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.channel.Window
org.apache.sshd.common.channel.LocalWindow
- All Implemented Interfaces:
Closeable, AutoCloseable, ChannelHolder
A
Window that describes how much data this side is prepared to receive from the peer. Initialized when the
channel is created. This side reduces the window by the amount of data received on reception; if it receives more
data than allowed, it closes the channel. Once the data received has been processed, for instance, passed on, this
side checks the current window size and if it is low, increases it and sends an SSH_MSG_CHANNEL_WINDOW_ADJUST message
to the peer, who then is allowed to send more data again.- Author:
- Apache MINA SSHD Project
-
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongconsume(long len) Consumelenbytes from the window.voidinit(org.apache.sshd.common.PropertyResolver resolver) Initializes theLocalWindowwith the packet and window sizes from theresolver.voidrelease(long len) Updates the window once data that has arrived in a channel has been read, making available room for the sender too send more data, sending a window adjust message if necessary.Methods inherited from class Window
checkInitialized, close, consumeAll, getMaxSize, getPacketSize, getSize, init, isOpen, largerThan, toString, updateSizeMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Constructor Details
-
LocalWindow
-
-
Method Details
-
getChannel
- Specified by:
getChannelin interfaceChannelHolder- Overrides:
getChannelin classWindow- Returns:
- The associated
Channelinstance
-
init
public void init(org.apache.sshd.common.PropertyResolver resolver) Initializes theLocalWindowwith the packet and window sizes from theresolver.- Parameters:
resolver-PropertyResolverto access properties
-
consume
Consumelenbytes from the window.- Specified by:
consumein classWindow- Parameters:
len- number of bytes to consume- Returns:
- the number of bytes by which the window was actually reduced
- Throws:
IOException- iflenif > the available space in the window
-
release
Updates the window once data that has arrived in a channel has been read, making available room for the sender too send more data, sending a window adjust message if necessary.- Parameters:
len- length of data read from the channel- Throws:
IOException- if sending a window adjust message fails
-