reconnectWebSocket method

  1. @Deprecated('Use closeStreamingConnection / openStreamingConnection instead.')
Future<void> reconnectWebSocket()

Closes the current web socket connection (if open), then connects again.

Implementation

@Deprecated('Use closeStreamingConnection / openStreamingConnection instead.')
Future<void> reconnectWebSocket() async {
  if (_webSocket == null) return;

  await _webSocket?.sink.close();
  _webSocket = null;
  _cancelConnectionTimer();

  await openStreamingConnection();
}