onListen method

  1. @override
StreamSubscription onListen()
override

Implement stream subscription

Implementation

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

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