Project JXTA

net.jxta.impl.util.pipe.reliable
Class FixedFlowControl

java.lang.Object
  extended by net.jxta.impl.util.pipe.reliable.FlowControl
      extended by net.jxta.impl.util.pipe.reliable.FixedFlowControl

public class FixedFlowControl
extends FlowControl


Field Summary
(package private) static int DEFAULT_RWINDOW
           
(package private)  int maxRwindow
           
(package private)  int rwindow
           
 
Constructor Summary
FixedFlowControl()
          Constructs a fixed flow control module with a fixed rwindow of DEFAULT_RWINDOW.
FixedFlowControl(int rwindow)
           
 
Method Summary
 int ackEventEnd(int rQSize, long aveRTT, long lastRTT)
          { @inheritDoc }
 int getRwindow()
          { @inheritDoc }
 
Methods inherited from class net.jxta.impl.util.pipe.reliable.FlowControl
ackEventBegin, packetACKed, packetMissing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RWINDOW

static final int DEFAULT_RWINDOW
See Also:
Constant Field Values

maxRwindow

int maxRwindow

rwindow

int rwindow
Constructor Detail

FixedFlowControl

public FixedFlowControl()
Constructs a fixed flow control module with a fixed rwindow of DEFAULT_RWINDOW. It is not completely fixed. It grows by one at every ack message until it reaches the set RWINDOW.


FixedFlowControl

public FixedFlowControl(int rwindow)
Parameters:
rwindow - Use the specified value as the constant rwindow
Method Detail

getRwindow

public int getRwindow()
{ @inheritDoc }

Specified by:
getRwindow in class FlowControl

ackEventEnd

public int ackEventEnd(int rQSize,
                       long aveRTT,
                       long lastRTT)
{ @inheritDoc }

Specified by:
ackEventEnd in class FlowControl
Parameters:
rQSize - the last known value of the remote queue size.
aveRTT - the latest estimate of the average RTT.
lastRTT - the RTT inferred from the most recent ACK message.
Returns:
int the new recommended value for rwindow.

JXTA J2SE