| 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 | 5 |
| 6 import "dart:io"; | 6 import "dart:io"; |
| 7 import "dart:uri"; | |
| 8 | 7 |
| 9 main() { | 8 main() { |
| 10 bool serverOnClosed = false; | 9 bool serverOnClosed = false; |
| 11 bool clientOnClosed = false; | 10 bool clientOnClosed = false; |
| 12 bool requestOnClosed = false; | 11 bool requestOnClosed = false; |
| 13 | 12 |
| 14 HttpServer.bind("127.0.0.1", 0).then((server) { | 13 HttpServer.bind("127.0.0.1", 0).then((server) { |
| 15 var client = new HttpClient(); | 14 var client = new HttpClient(); |
| 16 | 15 |
| 17 checkDone() { | 16 checkDone() { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 47 .then((response) { | 46 .then((response) { |
| 48 response.listen( | 47 response.listen( |
| 49 (_) {}, | 48 (_) {}, |
| 50 onDone: () { | 49 onDone: () { |
| 51 requestOnClosed = true; | 50 requestOnClosed = true; |
| 52 checkDone(); | 51 checkDone(); |
| 53 }); | 52 }); |
| 54 }); | 53 }); |
| 55 }); | 54 }); |
| 56 } | 55 } |
| OLD | NEW |