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

Side by Side Diff: sdk/lib/io/websocket_impl.dart

Issue 12386026: Close HttpServer in WebSocket tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; 7 const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
8 8
9 class _WebSocketMessageType { 9 class _WebSocketMessageType {
10 static const int NONE = 0; 10 static const int NONE = 0;
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 (data) => _processor.update(data, 0, data.length), 555 (data) => _processor.update(data, 0, data.length),
556 onDone: () => _processor.closed(), 556 onDone: () => _processor.closed(),
557 onError: (error) => _controller.signalError(error)); 557 onError: (error) => _controller.signalError(error));
558 558
559 _socket.done 559 _socket.done
560 .catchError((error) { 560 .catchError((error) {
561 if (_readyState == WebSocket.CLOSED) return; 561 if (_readyState == WebSocket.CLOSED) return;
562 _readyState = WebSocket.CLOSED; 562 _readyState = WebSocket.CLOSED;
563 _controller.signalError(error); 563 _controller.signalError(error);
564 _controller.close(); 564 _controller.close();
565 _processor.closed();
566 _socket.destroy(); 565 _socket.destroy();
567 }) 566 })
568 .whenComplete(() { 567 .whenComplete(() {
569 _writeClosed = true; 568 _writeClosed = true;
570 }); 569 });
571 } 570 }
572 571
573 StreamSubscription<Event> listen(void onData(Event event), 572 StreamSubscription<Event> listen(void onData(Event event),
574 {void onError(AsyncError error), 573 {void onError(AsyncError error),
575 void onDone(), 574 void onDone(),
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 691
693 class _WebSocketCloseEvent implements CloseEvent { 692 class _WebSocketCloseEvent implements CloseEvent {
694 _WebSocketCloseEvent(this._wasClean, this._code, this._reason); 693 _WebSocketCloseEvent(this._wasClean, this._code, this._reason);
695 bool get wasClean => _wasClean; 694 bool get wasClean => _wasClean;
696 int get code => _code; 695 int get code => _code;
697 String get reason => _reason; 696 String get reason => _reason;
698 bool _wasClean; 697 bool _wasClean;
699 int _code; 698 int _code;
700 String _reason; 699 String _reason;
701 } 700 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698