Project JXTA

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

java.lang.Object
  extended bynet.jxta.impl.util.pipe.reliable.FlowControl
      extended bynet.jxta.impl.util.pipe.reliable.AdaptiveFlowControl

public class AdaptiveFlowControl
extends FlowControl


Field Summary
(package private) static int DEFAULT_RWINDOW
           
(package private)  boolean fastMode
           
(package private)  int takeAchance
           
 
Constructor Summary
AdaptiveFlowControl()
          Constructs an adaptive flow control module with an initial rwindow of DEFAULT_RWINDOW.
AdaptiveFlowControl(int rwindow)
           
 
Method Summary
 void ackEventBegin()
          { @inheritDoc }
 int ackEventEnd(int rQSize, long aveRTT, long lastRTT)
          { @inheritDoc }
 int getRwindow()
          { @inheritDoc }
 void packetACKed(int seqnum)
          { @inheritDoc }
 void packetMissing(int seqnum)
          { @inheritDoc }
 
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

fastMode

boolean fastMode

takeAchance

int takeAchance
Constructor Detail

AdaptiveFlowControl

public AdaptiveFlowControl()
Constructs an adaptive flow control module with an initial rwindow of DEFAULT_RWINDOW.


AdaptiveFlowControl

public AdaptiveFlowControl(int rwindow)
Parameters:
rwindow - Use this value as the initial value (not recommended except for experimental purposes.
Method Detail

getRwindow

public int getRwindow()
{ @inheritDoc }

Specified by:
getRwindow in class FlowControl

ackEventBegin

public void ackEventBegin()
{ @inheritDoc }

Overrides:
ackEventBegin in class FlowControl

packetACKed

public void packetACKed(int seqnum)
{ @inheritDoc }

Overrides:
packetACKed in class FlowControl
Parameters:
seqnum - The sequence number of the received packet.

packetMissing

public void packetMissing(int seqnum)
{ @inheritDoc }

Overrides:
packetMissing in class FlowControl
Parameters:
seqnum - The sequence number of the missing packet.

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