listen method

Future listen ()

Starts listening to the underlying stream.

Returns a Future that will complete when the connection is closed or when it has an error. This is the same as done.

listen may only be called once.


Future listen() {, onError: (error, stackTrace) {
    _done.completeError(error, stackTrace);
  }, onDone: () {
    if (!_done.isCompleted) _done.complete();
  return done;