PacketManager class

Manages packet sending and receiving for a UDXStream

Constructors

PacketManager.new({CongestionController? congestionController})
Creates a new packet manager

Properties

congestionController CongestionController
The congestion control algorithm
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
lastSentPacketNumber int
The sequence number of the last packet that was sent.
getter/setter pair
nextSequence int
The next sequence number to use
no setter
onPacketPermanentlyLost ↔ void Function(UDXPacket packet)?
Callback for when a packet is considered permanently lost after max retries.
getter/setter pair
onRetransmit ↔ void Function(UDXPacket packet)?
Callback to be invoked when a packet needs to be retransmitted.
getter/setter pair
onSendProbe ↔ void Function(UDXPacket packet)?
Callback to be invoked when a probe packet needs to be sent.
getter/setter pair
retransmitTimeout int
The retransmission timeout in milliseconds
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sentPackets List<UDXPacket>
no setter

Methods

destroy() → void
Destroys the packet manager and cancels all timers
getNextRetransmit() UDXPacket?
Gets the next packet to retransmit
getPacket(int sequence) UDXPacket?
Gets a sent packet by its sequence number
getRetransmitTimersTestHook() Map<int, Timer>
getSentPacketsTestHook() Map<int, UDXPacket>
handleAckFrame(AckFrame frame) List<int>
Processes an incoming AckFrame, marking packets as acknowledged. Returns a list of sequence numbers that were successfully acknowledged by this frame.
handleData(UDXPacket packet) → void
Handles received data
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retransmitPacket(int sequence) → void
Retransmits a specific packet by its sequence number.
sendPacket(UDXPacket packet) → void
Sends a packet
sendProbe(ConnectionId destCid, ConnectionId srcCid, int destId, int srcId) → void
Sends a probe packet to elicit an ACK. The probe packet contains a PING frame.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

maxRetries → const int
The maximum number of retransmissions