| 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 ServerSocket.bind("127.0.0.1", 0) | 51 ServerSocket.bind("127.0.0.1", 0) |
| 52 .then((s) { | 52 .then((s) { |
| 53 ServerSocket.bind("127.0.0.1", s.port) | 53 ServerSocket.bind("127.0.0.1", 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 s.close(); | 59 s.close(); |
| 61 asyncEnd(); | 60 asyncEnd(); |
| 62 }); | 61 }); |
| 63 }); | 62 }); |
| 64 } | 63 } |
| 65 | 64 |
| 66 void testConnectNoDestroy() { | 65 void testConnectNoDestroy() { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 testConnectImmediateDestroy(); | 219 testConnectImmediateDestroy(); |
| 221 testConnectConsumerClose(); | 220 testConnectConsumerClose(); |
| 222 testConnectConsumerWriteClose(); | 221 testConnectConsumerWriteClose(); |
| 223 testConnectStreamClose(); | 222 testConnectStreamClose(); |
| 224 testConnectStreamDataClose(true); | 223 testConnectStreamDataClose(true); |
| 225 testConnectStreamDataClose(false); | 224 testConnectStreamDataClose(false); |
| 226 testConnectStreamDataCloseCancel(true); | 225 testConnectStreamDataCloseCancel(true); |
| 227 testConnectStreamDataCloseCancel(false); | 226 testConnectStreamDataCloseCancel(false); |
| 228 asyncEnd(); | 227 asyncEnd(); |
| 229 } | 228 } |
| OLD | NEW |