| Index: runtime/bin/socket_patch.dart
|
| diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
|
| index b46bf5ea4ca0aaee21e7d78918d0ce9ccdeb5e01..f31975e30242d672173abe8f9ab049b68b4e9098 100644
|
| --- a/runtime/bin/socket_patch.dart
|
| +++ b/runtime/bin/socket_patch.dart
|
| @@ -1068,7 +1068,15 @@ class _RawServerSocket extends Stream<RawSocket>
|
| .then((socket) => new _RawServerSocket(socket));
|
| }
|
|
|
| - _RawServerSocket(this._socket) {
|
| + _RawServerSocket(this._socket);
|
| +
|
| + StreamSubscription<RawSocket> listen(void onData(RawSocket event),
|
| + {Function onError,
|
| + void onDone(),
|
| + bool cancelOnError}) {
|
| + if (_controller != null) {
|
| + throw new StateError("Stream was already listened to");
|
| + }
|
| var zone = Zone.current;
|
| _controller = new StreamController(sync: true,
|
| onListen: _onSubscriptionStateChange,
|
| @@ -1087,14 +1095,7 @@ class _RawServerSocket extends Stream<RawSocket>
|
| _controller.addError(e);
|
| _controller.close();
|
| }),
|
| - destroyed: _controller.close
|
| - );
|
| - }
|
| -
|
| - StreamSubscription<RawSocket> listen(void onData(RawSocket event),
|
| - {Function onError,
|
| - void onDone(),
|
| - bool cancelOnError}) {
|
| + destroyed: _controller.close);
|
| return _controller.stream.listen(
|
| onData,
|
| onError: onError,
|
|
|