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.
CongestionController
Implements QUIC-style congestion control for UDX streams, based on RFC 9002.
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.
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
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
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
Enum for different frame types.
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)
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
Initial RTT estimate (RFC 9002 recommends 333ms)
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
maxMtu → const int
Maximum MTU to probe (common Ethernet MTU minus headers)
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)
minMtu → const int
Minimum MTU to probe (IPv6 minimum)
minStatelessResetPacketSize → const int
Minimum packet size for stateless reset
mtuProbeTimeout → const Duration
MTU probe timeout
statelessResetTokenLength → const int
Length of stateless reset token
udxVersionCurrent → const int
Current UDX protocol version
udxVersionV1 → const int
UDX Protocol Version 1 (original with fixed 8-byte CIDs)
udxVersionV2 → const int
UDX Protocol Version 2 (variable CIDs, enhanced QUIC compliance)

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.