connect method
Opens the socket and transitions through TransportConnectionStates.
Implementations MUST:
- Be safe to call multiple times (re-invocation after a disconnect should re-open; re-invocation on an open transport is a no-op).
- Start emitting TransportConnectionState updates via connectionState immediately.
- NOT throw; errors flow through the connectionState stream as
TransportDisconnected with an informative
reason.
Implementation
@override
Future<void> connect(TransportConfig config) async {
recorded.socketParams.add(Map.of(config.params));
_stateController.add(const TransportConnecting());
await Future<void>.delayed(Duration.zero);
_stateController.add(const TransportConnected());
}