UDXMultiplexer class
A class that demultiplexes incoming UDX packets to the correct UDPSocket
.
The UDXMultiplexer
listens on a single RawDatagramSocket
and forwards
packets to the appropriate UDPSocket
instance based on their destination
Connection ID (CID).
Constructors
- UDXMultiplexer.new(RawDatagramSocket socket)
Properties
-
connections
→ Stream<
UDPSocket> -
A stream of incoming UDX sockets.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- socket → RawDatagramSocket
-
The underlying UDP socket that this multiplexer listens on.
final
-
socketsByCid
→ Map<
ConnectionId, UDPSocket> -
A map of active connections, keyed by their local Connection ID.
final
-
socketsByPeer
→ Map<
String, UDPSocket> -
final
Methods
-
addSocket(
UDPSocket socket) → void - Registers an existing socket with this multiplexer. Used for connection migration.
-
close(
) → void - Closes the multiplexer and all associated sockets.
-
createSocket(
UDX udx, String host, int port, {ConnectionId? localCid, ConnectionId? remoteCid}) → UDPSocket -
Creates or retrieves a
UDPSocket
for a given peer. -
getSocketsForTest(
) → Map< ConnectionId, UDPSocket> -
handleIncomingDatagramForTest(
Uint8List data, InternetAddress address, int port) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeSocket(
ConnectionId localCid) → void - Removes a socket from the multiplexer's management.
-
send(
Uint8List data, InternetAddress address, int port) → void - Sends a datagram to the specified address and port.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited