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

Side by Side Diff: tests/standalone/io/socket_many_connections_test.dart

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 1 month 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 | « tests/standalone/io/secure_socket_test.dart ('k') | tests/standalone/io/testing_server.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 // Test creating a large number of socket connections. 5 // Test creating a large number of socket connections.
6 library ServerTest; 6 library ServerTest;
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 import "package:async_helper/async_helper.dart"; 9 import "package:async_helper/async_helper.dart";
10 import "dart:async"; 10 import "dart:async";
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 class TestServer extends TestingServer { 75 class TestServer extends TestingServer {
76 76
77 void onConnection(Socket connection) { 77 void onConnection(Socket connection) {
78 Socket _client; 78 Socket _client;
79 79
80 void closeHandler() { 80 void closeHandler() {
81 connection.close(); 81 connection.close();
82 } 82 }
83 83
84 void errorHandler(e) { 84 void errorHandler(e, trace) {
85 String msg = "Socket error $e"; 85 String msg = "Socket error $e";
86 var trace = getAttachedStackTrace(e);
87 if (trace != null) msg += "\nStackTrace: $trace"; 86 if (trace != null) msg += "\nStackTrace: $trace";
88 print(msg); 87 print(msg);
89 connection.close(); 88 connection.close();
90 } 89 }
91 90
92 _connections++; 91 _connections++;
93 connection.listen( 92 connection.listen(
94 (data) {}, 93 (data) {},
95 onDone: closeHandler, 94 onDone: closeHandler,
96 onError: errorHandler); 95 onError: errorHandler);
97 } 96 }
98 97
99 int _connections = 0; 98 int _connections = 0;
100 } 99 }
101 100
102 main() { 101 main() {
103 asyncStart(); 102 asyncStart();
104 SocketManyConnectionsTest test = new SocketManyConnectionsTest.start(); 103 SocketManyConnectionsTest test = new SocketManyConnectionsTest.start();
105 } 104 }
OLDNEW
« no previous file with comments | « tests/standalone/io/secure_socket_test.dart ('k') | tests/standalone/io/testing_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698