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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Pause the server socket subscription and resume it after having | 98 // Pause the server socket subscription and resume it after having |
99 // connected a number client sockets. Then connect more client | 99 // connected a number client sockets. Then connect more client |
100 // sockets. | 100 // sockets. |
101 subscription.pause(); | 101 subscription.pause(); |
102 var connectCount = 0; | 102 var connectCount = 0; |
103 for (int i = 0; i < socketCount; i++) { | 103 for (int i = 0; i < socketCount; i++) { |
104 SecureSocket.connect(HOST_NAME, server.port).then((connection) { | 104 SecureSocket.connect(HOST_NAME, server.port).then((connection) { |
105 connection.close(); | 105 connection.close(); |
106 }); | 106 }); |
107 } | 107 } |
108 new Timer(500, (_) { | 108 new Timer(const Duration(milliseconds: 500), () { |
109 subscription.resume(); | 109 subscription.resume(); |
110 resumed = true; | 110 resumed = true; |
111 for (int i = 0; i < socketCount; i++) { | 111 for (int i = 0; i < socketCount; i++) { |
112 SecureSocket.connect(HOST_NAME, server.port).then((connection) { | 112 SecureSocket.connect(HOST_NAME, server.port).then((connection) { |
113 connection.close(); | 113 connection.close(); |
114 }); | 114 }); |
115 } | 115 } |
116 }); | 116 }); |
117 }); | 117 }); |
118 } | 118 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 useBuiltinRoots: false); | 158 useBuiltinRoots: false); |
159 | 159 |
160 testCloseOneEnd("client"); | 160 testCloseOneEnd("client"); |
161 testCloseOneEnd("server"); | 161 testCloseOneEnd("server"); |
162 testCloseBothEnds(); | 162 testCloseBothEnds(); |
163 testPauseServerSocket(); | 163 testPauseServerSocket(); |
164 testCloseServer(); | 164 testCloseServer(); |
165 // TODO(whesse): Add testPauseSocket from raw_socket_test.dart. | 165 // TODO(whesse): Add testPauseSocket from raw_socket_test.dart. |
166 // TODO(whesse): Add testCancelResubscribeSocket from raw_socket_test.dart. | 166 // TODO(whesse): Add testCancelResubscribeSocket from raw_socket_test.dart. |
167 } | 167 } |
OLD | NEW |