UDXStream class

A reliable, ordered stream over UDP.

Implemented types
Mixed-in types

Constructors

UDXStream.new(UDX udx, int id, {bool framed = false, int initialSeq = 0, bool firewall(UDPSocket socket, int port, String host)?, int? initialCwnd, CongestionController? congestionControllerForTest, PacketManager? packetManagerForTest, bool isInitiator = false})
Creates a new UDX stream

Properties

ack Stream<int>
no setter
closeEvents Stream<void>
no setter
connected bool
Whether the stream is connected
no setter
cwnd int
The congestion window
no setter
data Stream<Uint8List>
no setter
done Future<void>
Return a future which is completed when the StreamSink is finished.
no setteroverride
drain Stream<void>
no setter
end Stream<void>
no setter
firewall bool Function(UDPSocket socket, int port, String host)?
The firewall function
final
framed bool
Whether the stream is in framed mode
final
hashCode int
The hash code for this object.
no setterinherited
id int
The stream ID
final
inflight int
The number of bytes in flight
no setter
initialSeq int
The initial sequence number
final
isInitiator bool
Whether this stream was created by this endpoint.
final
maxRetransmissionAttempts int
Maximum number of retransmission attempts before considering packet lost
getter/setter pair
message Stream<Uint8List>
no setter
mtu int
The maximum transmission unit (MTU)
no setter
packetManager PacketManager
The packet manager
latefinal
packetTimeoutTolerance int
Total timeout tolerance for packet-level operations (in seconds)
getter/setter pair
receiveWindow int
The local receive window size
no setter
remoteFamily int?
The remote address family
getter/setter pair
remoteHost String?
The remote host
getter/setter pair
remoteId int?
The remote stream ID
getter/setter pair
remotePort int?
The remote port
getter/setter pair
remoteReceiveWindow int
The remote peer's receive window size
no setter
rtt Duration
The round-trip time
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
send Stream<Uint8List>
no setter
udx UDX
The UDX instance that created this stream
final

Methods

add(Uint8List data) Future<void>
Adds a data event to the sink.
override
addError(Object error, [StackTrace? stackTrace]) → void
Adds an error to the sink.
override
addStream(Stream<Uint8List> stream) Future<void>
Consumes the elements of stream.
override
close() Future<void>
Tells the stream sink that no further streams will be added.
override
connect(UDPSocket socket, int remoteId, int port, String host) Future<void>
Connects the stream to a remote endpoint
emit(String event, [dynamic data]) → void
Emits an event of the given type with the given data
inherited
flushBufferedStreams(String event, UDXEventCallback callback, List buffer) → void
Flushes buffered events for a specific event type to a new listener.
inherited
getSentPacketsTestHook() Map<int, (DateTime, int)>
internalHandleSocketEvent(dynamic event) → void
Handles an incoming socket event (datagram).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on(String event) Stream<UDXEvent>
Returns a stream of events for the given type
inherited
reset(int errorCode) Future<void>
Abruptly terminates the stream by sending a RESET_STREAM frame.
setSocketForTest(UDPSocket? socket) → void
Sets the internal socket. For testing purposes only.
setWindow(int newSize) → void
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

createIncoming(UDX udx, UDPSocket socket, int localId, int remoteId, String host, int port, {required ConnectionId destinationCid, required ConnectionId sourceCid, bool framed = false, int initialSeq = 0, int? initialCwnd, bool firewall(UDPSocket socket, int port, String host)?}) UDXStream
createOutgoing(UDX udx, UDPSocket socket, int localId, int remoteId, String host, int port, {bool framed = false, int initialSeq = 0, int? initialCwnd, bool firewall(UDPSocket socket, int port, String host)?}) Future<UDXStream>
getMaxPayloadSizeTestHook() int