public class PacketThrottle
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_DELAY |
protected static long |
MAX_DELAY |
protected static long |
MIN_DELAY |
protected static double |
PACKET_DROP_DECREASE_MULTIPLE |
protected static double |
PACKET_TRANSMIT_INCREMENT |
protected static double |
SLOW_START_DIVISOR |
static java.lang.String |
VERSION |
Constructor and Description |
---|
PacketThrottle(int packetSize) |
Modifier and Type | Method and Description |
---|---|
double |
getBandwidth()
returns the number of bytes-per-second in the transmition link (?).
|
long |
getDelay()
Only used for diagnostics.
|
long |
getRoundTripTime() |
double |
getWindowSize() |
void |
maybeDisconnected() |
void |
notifyOfPacketAcknowledged(double maxWindowSize)
Notify the throttle that a packet was transmitted successfully.
|
void |
notifyOfPacketsLost(int numPackets) |
void |
setRoundTripTime(long rtt) |
java.lang.String |
toString() |
protected static final double PACKET_DROP_DECREASE_MULTIPLE
protected static final double PACKET_TRANSMIT_INCREMENT
protected static final double SLOW_START_DIVISOR
protected static final long MAX_DELAY
protected static final long MIN_DELAY
public static final java.lang.String VERSION
public static final long DEFAULT_DELAY
public void setRoundTripTime(long rtt)
public void notifyOfPacketsLost(int numPackets)
public void notifyOfPacketAcknowledged(double maxWindowSize)
maxWindowSize
- The maximum window size. This should be at least twice the largest window
size actually seen in flight at any time so far. We will ensure that the throttle's window size
does not get bigger than this. This works even for new packet format, and solves some of the
problems that RFC 2861 does.public long getDelay()
public java.lang.String toString()
toString
in class java.lang.Object
public long getRoundTripTime()
public double getWindowSize()
public double getBandwidth()
public void maybeDisconnected()