connect method

Future<PhoenixSocket?> connect()

Attempts to make a WebSocket connection to the Phoenix backend.

If the attempt fails, retries will be triggered at intervals specified by retryAfterIntervalMS

Implementation

Future<PhoenixSocket?> connect() async {
  final completer = Completer<PhoenixSocket?>();
  runZonedGuarded(
    () => _connect(completer),
    (error, stack) {},
  );
  return completer.future;
}