dart_udx library

Classes

AckFrame
ACK Frame (Type 0x02) Acknowledges one or more packet ranges. Based on QUIC ACK Frame (RFC 9000, Section 19.3). Includes optional ECN counts for Explicit Congestion Notification.
AckRange
Helper class for ACK ranges in an AckFrame.
Clock
The clock the transport's timing runs on: a monotonic instant for RTT samples, send times, ACK delay, pacing and the idle check, and the timers the PTO, the loss timer, the ACK timer and the watchdog are armed on.
CongestionController
QUIC-style congestion control for a UDX connection, after RFC 9002, with CUBIC congestion avoidance.
ConnectionCids
A public class to hold the local and remote CIDs for a connection.
ConnectionCloseFrame
CONNECTION_CLOSE Frame (Type 0x0b) Signals graceful or error termination of the connection. Contains error code, frame type that caused error (if applicable), and a human-readable reason phrase.
ConnectionId
Represents a UDX Connection Identifier (CID).
DataBlockedFrame
DATA_BLOCKED Frame (Type 0x0e) Indicates that the connection is blocked due to connection-level flow control. Sent when the sender wants to send data but is blocked by the connection-level MAX_DATA limit.
FakeClock
A clock a test moves by hand: advance passes time and fires the timers that fall due, in due order, each seeing the clock at its own due time.
Frame
Base class for all UDX frames.
MaxDataFrame
MAX_DATA Frame (Type 0x05) Informs the peer of the maximum amount of data that can be sent on the connection.
MaxStreamsFrame
MAX_STREAMS Frame (Type 0x07) Informs the peer of the maximum number of concurrent streams the sender is willing to accept.
MtuProbeFrame
MTU_PROBE Frame (Type 0x08) Used for DPLPMTUD (RFC 8899). This frame is used to pad a packet to a specific size to probe if the path supports a larger MTU.
NewConnectionIdFrame
NEW_CONNECTION_ID Frame (Type 0x10) Provides the peer with a new Connection ID that can be used for this connection. This enables connection migration and prevents linkability attacks.
PacketManager
Manages packet sending and receiving for a UDXStream Tracks sent packets, matches ACKs to them, and declares loss the way RFC 9002 section 6.1 does: from acknowledgements, never from a per-packet timer. The port of go-udx's PacketManager.
PaddingFrame
PADDING Frame (Type 0x00) Used to ensure a packet has a minimum size.
PathChallengeFrame
PATH_CHALLENGE Frame (Type 0x09) Used to validate a new network path during connection migration. Contains arbitrary data that the peer must echo back.
PathResponseFrame
PATH_RESPONSE Frame (Type 0x0a) Used to respond to a PATH_CHALLENGE. Must contain the exact same data as the challenge frame it is responding to.
PingFrame
PING Frame (Type 0x01) Used to elicit an ACK from the peer.
ResetStreamFrame
RESET_STREAM Frame (Type 0x06) Informs the peer that a stream is being abruptly terminated.
RetireConnectionIdFrame
RETIRE_CONNECTION_ID Frame (Type 0x11) Indicates that the endpoint will no longer use a Connection ID that was issued by the peer. This also serves as a request for the peer to send a new Connection ID.
StatelessResetPacket
A STATELESS_RESET packet that can be sent by a server that has lost connection state. It looks like a regular packet but is identified by the presence of a valid stateless reset token.
StatelessResetToken
Represents a stateless reset token used to validate STATELESS_RESET packets.
StopSendingFrame
STOP_SENDING Frame (Type 0x0d) Signals that the endpoint no longer wishes to receive data on a stream. The peer should close the write side of the stream in response.
StreamDataBlockedFrame
STREAM_DATA_BLOCKED Frame (Type 0x0f) Indicates that a stream is blocked due to stream-level flow control. Sent when the sender wants to send data on a stream but is blocked by the stream-level flow control limit.
StreamFrame
STREAM Frame (Type 0x03) Carries data for a specific stream.
StreamIdHelper
Helper class for QUIC-style stream ID encoding
SystemClock
The real monotonic clock. Every instance reads one process-wide stopwatch, so instants from any of them compare.
UDPSocket
Represents a single UDX connection, managed by a UDXMultiplexer.
UDX
The main UDX class that provides reliable, multiplexed, and congestion-controlled streams over UDP.
UdxErrorCode
UDX error codes for CONNECTION_CLOSE and RESET_STREAM frames
UDXEvent
Base class for all UDX events
UdxLogging
Centralized logging for dart-udx
UdxMetricsObserver
Observer interface for UDX metrics and events.
UDXMultiplexer
A class that demultiplexes incoming UDX packets to the correct UDPSocket.
UDXPacket
A UDX packet with stream information and a list of frames.
UDXStream
A reliable, ordered stream over UDP.
UdxVersion
UDX protocol version constants
VersionNegotiationPacket
A VERSION_NEGOTIATION packet sent by the server when client requests an unsupported version.
WindowUpdateFrame
WINDOW_UPDATE Frame (Type 0x04) Informs the peer of a change in the sender's receive window.

Enums

FrameType
Frame types and their type bytes on the wire.
StreamType
Defines the directionality of a stream

Mixins

UDXEventEmitter
Mixin that provides event emitting capabilities

Constants

ackDelayExponent → const int
ACK delay exponent for encoding ACK delay field
amplificationFactor → const int
Amplification factor for anti-amplification limits (RFC 9000)
blackholePackets → const int
How many full-size data packets must be lost in a row, with none acknowledged in between, before the path is taken to have shrunk.
blackholePtos → const int
The same conclusion from probe timeouts, when nothing at all is acknowledged any more.
blackholeRetry → const Duration
How long after a black hole the search starts over.
defaultCidLength → const int
Default Connection ID length (for backward compatibility)
defaultStreamPriority → const int
Default stream priority (0-255, lower = higher priority)
errorConnectionTimeout → const int
Connection timeout
errorFlowControlError → const int
Flow control error
errorInternalError → const int
Internal error
errorInvalidMigration → const int
Invalid connection migration
errorNoError → const int
No error - graceful close
errorProtocolViolation → const int
Protocol violation
errorStreamLimitError → const int
Stream limit exceeded
handshakeTimeout → const Duration
Maximum time to wait for handshake completion
initialCongestionWindow → const int
Initial congestion window size (10 packets as per RFC 9002)
initialMaxData → const int
Constants and configuration values for dart-udx
initialMaxStreamData → const int
Initial maximum data that can be sent on a stream (64 KB)
initialMaxStreams → const int
Initial maximum number of concurrent bidirectional streams
initialRtt → const Duration
The smoothed RTT before the first sample (RFC 9002 section 6.2.2), with initialRttVar its variation: the first PTO is about a second. The estimate used to start at 100 ms, so on a slow path the first probe went out before the handshake could answer.
initialRttVar → const Duration
lossDetectionThresholdDen → const double
lossDetectionThresholdNum → const double
Loss detection threshold (as fraction, 9/8 = 1.125)
maxAckDelay → const int
Maximum ACK delay in milliseconds (RFC 9002)
maxCidLength → const int
Maximum Connection ID length
maxCongestionWindow → const int
Maximum congestion window size (to prevent overflow)
maxDatagramSize → const int
Maximum datagram size (typical MTU minus IP/UDP headers)
maxIdleTimeout → const Duration
Maximum idle timeout before closing connection
maxStreamPriority → const int
Maximum stream priority value
minBytesForValidation → const int
Minimum bytes received before considering address validated
minCidLength → const int
Minimum Connection ID length
minCongestionWindow → const int
Minimum congestion window size (in bytes)
minStatelessResetPacketSize → const int
Minimum packet size for stateless reset
mtuProbeTries → const int
How many times a probe size is lost before it is ruled out: one loss is as likely congestion as a path that cannot carry it.
mtuSearchStep → const int
The search ends once the validated size is this close to one that failed.
safeDatagramSize → const int
The largest datagram stream data goes out in: what any internet path carries, as QUIC's 1200 (RFC 9000 section 14), so it fits the 1280-byte IPv6 minimum MTU with its headers. Mobile carriers' tunnels (464XLAT, GTP) carry less than 1500 and drop a larger datagram that may not be fragmented: a write of more than one full datagram then never arrives, and the connection is given up. go-udx sends the same size.
statelessResetTokenLength → const int
Length of stateless reset token
streamPacketOverhead → const int
A stream packet's bytes besides its data: the packet header with both connection IDs at their longest (20 bytes each), and the stream frame's header.

Typedefs

UDXEventCallback = void Function(UDXEvent event)
A type definition for the event callback function.
UdxLogger = void Function(String level, String message)
Logging infrastructure for dart-udx

Exceptions / Errors

StreamLimitExceededError
Custom error for when a stream creation attempt exceeds the peer's advertised limit.
StreamResetError
Custom error for when a stream is reset by a peer.