| 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 "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 server.close(); | 234 server.close(); |
| 235 port.close(); | 235 port.close(); |
| 236 } | 236 } |
| 237 }); | 237 }); |
| 238 | 238 |
| 239 // Pause the server socket subscription and resume it after having | 239 // Pause the server socket subscription and resume it after having |
| 240 // connected a number client sockets. Then connect more client | 240 // connected a number client sockets. Then connect more client |
| 241 // sockets. | 241 // sockets. |
| 242 subscription.pause(); | 242 subscription.pause(); |
| 243 var connectCount = 0; | 243 var connectCount = 0; |
| 244 for (int i = 0; i <= socketCount / 2; i++) { | 244 for (int i = 0; i < socketCount / 2; i++) { |
| 245 RawSocket.connect("127.0.0.1", server.port).then((_) { | 245 RawSocket.connect("127.0.0.1", server.port).then((_) { |
| 246 if (++connectCount == socketCount / 2) { | 246 if (++connectCount == socketCount / 2) { |
| 247 subscription.resume(); | 247 subscription.resume(); |
| 248 resumed = true; | 248 resumed = true; |
| 249 for (int i = connectCount; i < socketCount; i++) { | 249 for (int i = connectCount; i < socketCount; i++) { |
| 250 RawSocket.connect("127.0.0.1", server.port).then((_) {}); | 250 RawSocket.connect("127.0.0.1", server.port).then((_) {}); |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 }); | 253 }); |
| 254 } | 254 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 testSimpleBind(); | 340 testSimpleBind(); |
| 341 testCloseOneEnd("client"); | 341 testCloseOneEnd("client"); |
| 342 testCloseOneEnd("server"); | 342 testCloseOneEnd("server"); |
| 343 testInvalidBind(); | 343 testInvalidBind(); |
| 344 testSimpleConnect(); | 344 testSimpleConnect(); |
| 345 testServerListenAfterConnect(); | 345 testServerListenAfterConnect(); |
| 346 testSimpleReadWrite(); | 346 testSimpleReadWrite(); |
| 347 testPauseServerSocket(); | 347 testPauseServerSocket(); |
| 348 testPauseSocket(); | 348 testPauseSocket(); |
| 349 } | 349 } |
| OLD | NEW |