OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library io_client; | 5 library io_client; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'base_client.dart'; | 10 import 'base_client.dart'; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 wrapInputStream(response.inputStream), | 66 wrapInputStream(response.inputStream), |
67 response.statusCode, | 67 response.statusCode, |
68 response.contentLength, | 68 response.contentLength, |
69 request: request, | 69 request: request, |
70 headers: headers, | 70 headers: headers, |
71 isRedirect: response.isRedirect, | 71 isRedirect: response.isRedirect, |
72 persistentConnection: response.persistentConnection, | 72 persistentConnection: response.persistentConnection, |
73 reasonPhrase: response.reasonPhrase)); | 73 reasonPhrase: response.reasonPhrase)); |
74 }; | 74 }; |
75 | 75 |
76 return new Future.wait([ | 76 return Future.wait([ |
77 completer.future, | 77 completer.future, |
78 pipeCompleter.future | 78 pipeCompleter.future |
79 ]).then((values) => values.first); | 79 ]).then((values) => values.first); |
80 } | 80 } |
81 | 81 |
82 /// Closes the client. This terminates all active connections. If a client | 82 /// Closes the client. This terminates all active connections. If a client |
83 /// remains unclosed, the Dart process may not terminate. | 83 /// remains unclosed, the Dart process may not terminate. |
84 void close() { | 84 void close() { |
85 if (_inner != null) _inner.shutdown(force: true); | 85 if (_inner != null) _inner.shutdown(force: true); |
86 _inner = null; | 86 _inner = null; |
87 } | 87 } |
88 } | 88 } |
OLD | NEW |