Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: dart/runtime/bin/socket_patch.dart

Issue 250453004: Version 1.3.4 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.3/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dart/tests/standalone/io/http_server_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/bin/socket_patch.dart
===================================================================
--- dart/runtime/bin/socket_patch.dart (revision 35362)
+++ dart/runtime/bin/socket_patch.dart (working copy)
@@ -1068,7 +1068,15 @@
.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 @@
_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,
« no previous file with comments | « no previous file | dart/tests/standalone/io/http_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698