onListen method

  1. @override
StreamSubscription onListen()
override

Implement stream subscription

Implementation

@override
StreamSubscription onListen() {
  final webSocket = client;
  if (webSocket == null) {
    throw StateError('webSocket is null');
  }

  return webSocket.listen(onData, onError: onError, onDone: onDone);
}