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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 const int _OUTGOING_BUFFER_SIZE = 8 * 1024; | 7 const int _OUTGOING_BUFFER_SIZE = 8 * 1024; |
8 | 8 |
9 class _HttpIncoming extends Stream<List<int>> { | 9 class _HttpIncoming extends Stream<List<int>> { |
10 final int _transferLength; | 10 final int _transferLength; |
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 ..remotePort = socket.remotePort | 2394 ..remotePort = socket.remotePort |
2395 ..localPort = socket.port; | 2395 ..localPort = socket.port; |
2396 } catch (e) { } | 2396 } catch (e) { } |
2397 return null; | 2397 return null; |
2398 } | 2398 } |
2399 } | 2399 } |
2400 | 2400 |
2401 | 2401 |
2402 class _DetachedSocket extends Stream<List<int>> implements Socket { | 2402 class _DetachedSocket extends Stream<List<int>> implements Socket { |
2403 final Stream<List<int>> _incoming; | 2403 final Stream<List<int>> _incoming; |
2404 final Socket _socket; | 2404 final _socket; |
2405 | 2405 |
2406 _DetachedSocket(this._socket, this._incoming); | 2406 _DetachedSocket(this._socket, this._incoming); |
2407 | 2407 |
2408 StreamSubscription<List<int>> listen(void onData(List<int> event), | 2408 StreamSubscription<List<int>> listen(void onData(List<int> event), |
2409 {Function onError, | 2409 {Function onError, |
2410 void onDone(), | 2410 void onDone(), |
2411 bool cancelOnError}) { | 2411 bool cancelOnError}) { |
2412 return _incoming.listen(onData, | 2412 return _incoming.listen(onData, |
2413 onError: onError, | 2413 onError: onError, |
2414 onDone: onDone, | 2414 onDone: onDone, |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2702 const _RedirectInfo(this.statusCode, this.method, this.location); | 2702 const _RedirectInfo(this.statusCode, this.method, this.location); |
2703 } | 2703 } |
2704 | 2704 |
2705 String _getHttpVersion() { | 2705 String _getHttpVersion() { |
2706 var version = Platform.version; | 2706 var version = Platform.version; |
2707 // Only include major and minor version numbers. | 2707 // Only include major and minor version numbers. |
2708 int index = version.indexOf('.', version.indexOf('.') + 1); | 2708 int index = version.indexOf('.', version.indexOf('.') + 1); |
2709 version = version.substring(0, index); | 2709 version = version.substring(0, index); |
2710 return 'Dart/$version (dart:io)'; | 2710 return 'Dart/$version (dart:io)'; |
2711 } | 2711 } |
OLD | NEW |