| 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 import "dart:async"; | 5 import "dart:async"; |
| 6 import "dart:io"; | 6 import "dart:io"; |
| 7 import "dart:isolate"; | 7 import "dart:isolate"; |
| 8 | 8 |
| 9 void sendData(List<int> data, int port) { | 9 void sendData(List<int> data, int port) { |
| 10 Socket.connect("127.0.0.1", port).then((socket) { | 10 Socket.connect("127.0.0.1", port).then((socket) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 server.close(); | 145 server.close(); |
| 146 }); | 146 }); |
| 147 }); | 147 }); |
| 148 Socket.connect("localhost", server.port) | 148 Socket.connect("localhost", server.port) |
| 149 .then((socket) { | 149 .then((socket) { |
| 150 socket.write("GET / HTTP/1.1\r\n"); | 150 socket.write("GET / HTTP/1.1\r\n"); |
| 151 socket.write("Content-Length: 10\r\n"); | 151 socket.write("Content-Length: 10\r\n"); |
| 152 socket.write("\r\n"); | 152 socket.write("\r\n"); |
| 153 socket.write("data"); | 153 socket.write("data"); |
| 154 socket.close(); | 154 socket.close(); |
| 155 socket.listen((_) {}); | 155 socket.listen((_) {}, onError: (_) {}); |
| 156 socket.done.catchError((_) {}); |
| 156 }); | 157 }); |
| 157 }); | 158 }); |
| 158 } | 159 } |
| 159 | 160 |
| 160 void main() { | 161 void main() { |
| 161 testEarlyClose1(); | 162 testEarlyClose1(); |
| 162 testEarlyClose2(); | 163 testEarlyClose2(); |
| 163 testEarlyClose3(); | 164 testEarlyClose3(); |
| 164 } | 165 } |
| OLD | NEW |