OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // VMOptions= | 5 // VMOptions= |
6 // VMOptions=--short_socket_read | 6 // VMOptions=--short_socket_read |
7 // VMOptions=--short_socket_write | 7 // VMOptions=--short_socket_write |
8 // VMOptions=--short_socket_read --short_socket_write | 8 // VMOptions=--short_socket_read --short_socket_write |
9 // | 9 // |
10 // Test socket close events. | 10 // Test socket close events. |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 _mode = command; | 353 _mode = command; |
354 ServerSocket.bind("127.0.0.1", 0).then((server) { | 354 ServerSocket.bind("127.0.0.1", 0).then((server) { |
355 _server = server; | 355 _server = server; |
356 _server.listen( | 356 _server.listen( |
357 (socket) { | 357 (socket) { |
358 var data = new ConnectionData(socket); | 358 var data = new ConnectionData(socket); |
359 connectionHandler(data); | 359 connectionHandler(data); |
360 }, | 360 }, |
361 onError: errorHandlerServer | 361 onError: errorHandlerServer |
362 ); | 362 ); |
363 replyTo.send(_server.port, null); | 363 replyTo.send(_server.port); |
364 }); | 364 }); |
365 } else { | 365 } else { |
366 Timer.run(waitForResult); | 366 Timer.run(waitForResult); |
367 } | 367 } |
368 } | 368 } |
369 | 369 |
370 ServerSocket _server; | 370 ServerSocket _server; |
371 final ReceivePort _dispatchPort; | 371 final ReceivePort _dispatchPort; |
372 SendPort _donePort; | 372 SendPort _donePort; |
373 int _readBytes; | 373 int _readBytes; |
(...skipping 13 matching lines...) Expand all Loading... |
387 // 3: Client sends. Server responds and destroys. | 387 // 3: Client sends. Server responds and destroys. |
388 // 4: Client sends and half-closes. Server responds and destroys. | 388 // 4: Client sends and half-closes. Server responds and destroys. |
389 // 5: Client sends. Server responds and half closes. | 389 // 5: Client sends. Server responds and half closes. |
390 // 6: Client sends and half-closes. Server responds and half closes. | 390 // 6: Client sends and half-closes. Server responds and half closes. |
391 var tests = 7; | 391 var tests = 7; |
392 for (var i = 0; i < tests; i++) { | 392 for (var i = 0; i < tests; i++) { |
393 asyncStart(); | 393 asyncStart(); |
394 new SocketClose.start(i, asyncEnd); | 394 new SocketClose.start(i, asyncEnd); |
395 } | 395 } |
396 } | 396 } |
OLD | NEW |