TxSocket class

TxSocket class to handle the WebSocket connection (dart:html implementation)

Mixed-in types

Constructors

TxSocket(String hostAddress)
Default constructor that initializes the host address and logger

Properties

connectionStartTime int?
getter/setter pairinherited
expectedPingTimer Timer?
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
hostAddress String
getter/setter pair
lastPingTimestamp int?
getter/setter pairinherited
missedPingCount int
getter/setter pairinherited
onClose OnCloseCallback
getter/setter pair
onMessage OnMessageCallback
getter/setter pair
onOpen OnOpenCallback
getter/setter pair
onPing OnPingCallback?
getter/setter pairinherited
pingIntervals List<int>
finalinherited
pingTimestamps List<int>
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

calculateConnectionMetrics() SocketConnectionMetrics
Calculates current connection metrics based on ping history. Returns CALCULATING quality when insufficient data is available, then progressively provides better assessment as more pings are received.
inherited
cleanPingIntervals() → void
Cleans up ping tracking data
inherited
close() → void
Close the WebSocket connection
connect() → void
Connect to the WebSocket server
emitInitialMetrics() → void
Emits the initial metrics in calculating state
inherited
getConnectionMetrics() SocketConnectionMetrics
Gets the current connection metrics
inherited
handlePingReceived() → void
Handles a received ping from the server and tracks timing information
inherited
initializePingTracking() → void
Initializes ping tracking at connection start
inherited
isPingMessage(dynamic data) bool
Checks if the received message is a ping message
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetExpectedPingTimer() → void
Resets the timer that tracks expected pings
inherited
send(dynamic data) → void
Send data to the WebSocket server
toString() String
A string representation of this object.
inherited

Operators

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