| 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 import "dart:async"; | 10 import "dart:async"; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 asyncEnd(); | 46 asyncEnd(); |
| 47 }); | 47 }); |
| 48 | 48 |
| 49 // Bind to a port already in use. | 49 // Bind to a port already in use. |
| 50 asyncStart(); | 50 asyncStart(); |
| 51 RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0) | 51 RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0) |
| 52 .then((s) { | 52 .then((s) { |
| 53 RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, s.port) | 53 RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, s.port) |
| 54 .then((t) { | 54 .then((t) { |
| 55 Expect.fail("Multiple listens on same port"); | 55 Expect.fail("Multiple listens on same port"); |
| 56 port.toSendPort().send(1); | |
| 57 }) | 56 }) |
| 58 .catchError((error) { | 57 .catchError((error) { |
| 59 Expect.isTrue(error is SocketException); | 58 Expect.isTrue(error is SocketException); |
| 60 asyncEnd(); | 59 asyncEnd(); |
| 61 }); | 60 }); |
| 62 }); | 61 }); |
| 63 } | 62 } |
| 64 | 63 |
| 65 void testSimpleConnect() { | 64 void testSimpleConnect() { |
| 66 asyncStart(); | 65 asyncStart(); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 testCloseOneEnd("server"); | 384 testCloseOneEnd("server"); |
| 386 testInvalidBind(); | 385 testInvalidBind(); |
| 387 testSimpleConnect(); | 386 testSimpleConnect(); |
| 388 testServerListenAfterConnect(); | 387 testServerListenAfterConnect(); |
| 389 testSimpleReadWrite(dropReads: false); | 388 testSimpleReadWrite(dropReads: false); |
| 390 testSimpleReadWrite(dropReads: true); | 389 testSimpleReadWrite(dropReads: true); |
| 391 testPauseServerSocket(); | 390 testPauseServerSocket(); |
| 392 testPauseSocket(); | 391 testPauseSocket(); |
| 393 asyncEnd(); | 392 asyncEnd(); |
| 394 } | 393 } |
| OLD | NEW |