updateState abstract method
Updates the state of a connection and notifies listeners of the state change.
This method is used to transition a connection between different states in its lifecycle. State changes trigger notifications to any listeners subscribed to the connection's state stream.
conn
The transport connection whose state is being updated.
state
The new state to set for the connection.
error
Optional error object that may be provided when transitioning to an error state.
Implementation
void updateState(TransportConn conn, ConnectionState state, {required Object? error});