Class RemoteWindow

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.channel.Window
org.apache.sshd.common.channel.RemoteWindow
All Implemented Interfaces:
Closeable, AutoCloseable, ChannelHolder

public class RemoteWindow extends Window
A Window reflecting this side's view of the peer's LocalWindow. A RemoteWindow is initialized when the peer announces its packet and window sizes in the initial message exchange when opening a channel. Whenever this side wants to send data, it checks whether the remote window has still enough space; if not, it sends only as much data as possible. When data is sent, the remote window size is reduced by the number of data bytes sent. When the window size drops to zero, no data is sent at all, and this side will have to wait for an SSH_MSG_CHANNEL_WINDOW_ADJUST message from the peer, which will increase the available window size again.
Author:
Apache MINA SSHD Project
  • Field Summary

    Fields inherited from class Window

    lock

    Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

    log
  • Constructor Summary

    Constructors
    Constructor
    Description
    RemoteWindow(Channel channel, boolean isClient)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    consume(long len)
    Consume len bytes from the window.
    void
    expand(long increment)
     
    void
    init(long size, long packetSize, org.apache.sshd.common.PropertyResolver resolver)
    Initializes the RemoteWindow with the packet and window sizes received from the peer.
    void
    waitAndConsume(long len, long maxWaitTime)
    Waits for enough data to become available to consume the specified size
    void
    waitAndConsume(long len, Duration maxWaitTime)
    Waits for enough data to become available to consume the specified size, then consumes it.
    protected void
    waitForCondition(Predicate<? super Window> predicate, Duration maxWaitTime)
    Waits up to a specified amount of time for a condition to be satisfied and signaled via the lock.
    long
    waitForSpace(long maxWaitTime)
    Waits until some data becomes available or timeout expires
    long
    waitForSpace(Duration maxWaitTime)
    Waits until some data becomes available or timeout expires

    Methods 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

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait