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 part of dart_io; | |
6 | |
7 class _SocketInputStream implements InputStream { | 5 class _SocketInputStream implements InputStream { |
8 _SocketInputStream(Socket socket) : _socket = socket { | 6 _SocketInputStream(Socket socket) : _socket = socket { |
9 if (_socket._closed) _closed = true; | 7 if (_socket._closed) _closed = true; |
10 _socket.onClosed = _onClosed; | 8 _socket.onClosed = _onClosed; |
11 } | 9 } |
12 | 10 |
13 List<int> read([int len]) { | 11 List<int> read([int len]) { |
14 return _socket.read(len); | 12 return _socket.read(len); |
15 } | 13 } |
16 | 14 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 198 } |
201 } | 199 } |
202 | 200 |
203 Socket _socket; | 201 Socket _socket; |
204 _BufferList _pendingWrites; | 202 _BufferList _pendingWrites; |
205 Function _onNoPendingWrites; | 203 Function _onNoPendingWrites; |
206 Function _onClosed; | 204 Function _onClosed; |
207 bool _closing = false; | 205 bool _closing = false; |
208 bool _closed = false; | 206 bool _closed = false; |
209 } | 207 } |
OLD | NEW |