CongestionController class
Implements QUIC-style congestion control for UDX streams, based on RFC 9002.
Constructors
- CongestionController.new({required PacketManager packetManager, int? initialCwnd})
Properties
- cwnd → int
-
The current congestion window size in bytes.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- inflight → int
-
The number of bytes in flight.
no setter
- isInRecoveryForTest → bool
-
Flag indicating if the controller is in a fast recovery phase.
no setter
- latestRttForTest → Duration
-
The latest RTT sample, exposed for testing.
no setter
- maxPtoRetries ↔ int
-
Maximum number of PTO retries before considering connection issues
getter/setter pair
- minRtt → Duration
-
The minimum RTT observed so far.
no setter
- onFastRetransmit ↔ void Function(int sequence)?
-
Callback for fast retransmit.
getter/setter pair
- onProbe ↔ void Function()?
-
Callback for when a probe packet should be sent.
getter/setter pair
- pacingController → PacingController
-
The packet pacer.
final
- packetManager → PacketManager
-
final
- pto → Duration
-
The Probe Timeout (PTO) duration.
no setter
- rttVar → Duration
-
The RTT variation.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- smoothedRtt → Duration
-
The smoothed round-trip time.
no setter
- ssthresh → int
-
The slow start threshold.
no setter
Methods
-
destroy(
) → void - Destroys the congestion controller and cancels all timers.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPacketAcked(
int bytes, DateTime sentTime, Duration ackDelay, bool isNewCumulativeAck, int currentFrameLargestAcked) → void -
Called when a packet is acknowledged.
bytes
is the size of the acknowledged packet.sentTime
is the time the acknowledged packet was sent.ackDelay
is the delay the receiver waited before sending the ACK.isNewCumulativeAck
true if the ACK frame advanced the highest cumulative ACK point.currentFrameLargestAcked
the 'largest_acked' value from the current ACK frame. -
onPacketLost(
int bytes, List< UDXPacket> lostPackets) → void - Called when a packet is considered lost.
-
onPacketSent(
int bytes) → void - Called when a packet is sent.
-
processDuplicateAck(
int frameLargestAcked) → void -
Called by UDXStream when an ACK frame is received that does not advance the _highestProcessedCumulativeAck.
frameLargestAcked
is the 'largest_acked' value from this duplicate ACK frame. -
setRttVar(
Duration rttVar) → void - Sets the RTT variation for testing purposes.
-
setSmoothedRtt(
Duration rtt) → void - Sets the smoothed RTT for testing purposes.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- initialCwnd → int
-
final
Constants
- betaCubic → const double
- c → const double
- kPersistentCongestionThreshold → const int
- maxDatagramSize → const int
- minCwnd → const int