OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 * SocketNativeWrapper is defined in native and holds a field to store the | 6 * SocketNativeWrapper is defined in native and holds a field to store the |
7 * native socket object. | 7 * native socket object. |
8 */ | 8 */ |
9 class _SocketBase { | 9 class _SocketBase { |
10 | 10 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 void setDataHandler(void callback()) { | 271 void setDataHandler(void callback()) { |
272 _setHandler(_IN_EVENT, callback); | 272 _setHandler(_IN_EVENT, callback); |
273 } | 273 } |
274 | 274 |
275 void setCloseHandler(void callback()) { | 275 void setCloseHandler(void callback()) { |
276 _setHandler(_CLOSE_EVENT, callback); | 276 _setHandler(_CLOSE_EVENT, callback); |
277 } | 277 } |
278 | 278 |
279 InputStream get inputStream() { | 279 InputStream get inputStream() { |
280 if (_inputStream === null) { | 280 if (_inputStream == null) { |
281 _inputStream = new SocketInputStream(this); | 281 _inputStream = new SocketInputStream(this); |
282 } | 282 } |
283 return _inputStream; | 283 return _inputStream; |
284 } | 284 } |
285 | 285 |
286 OutputStream get outputStream() { | 286 OutputStream get outputStream() { |
287 if (_outputStream === null) { | 287 if (_outputStream == null) { |
288 _outputStream = new SocketOutputStream(this); | 288 _outputStream = new SocketOutputStream(this); |
289 } | 289 } |
290 return _outputStream; | 290 return _outputStream; |
291 } | 291 } |
292 | 292 |
293 SocketInputStream _inputStream; | 293 SocketInputStream _inputStream; |
294 SocketOutputStream _outputStream; | 294 SocketOutputStream _outputStream; |
295 } | 295 } |
296 | 296 |
OLD | NEW |