| 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 class _SocketBase { | 6 class _SocketBase { |
| 7 // Bit flags used when communicating between the eventhandler and | 7 // Bit flags used when communicating between the eventhandler and |
| 8 // dart code. The EVENT flags are used to indicate events of | 8 // dart code. The EVENT flags are used to indicate events of |
| 9 // interest when sending a message from dart code to the | 9 // interest when sending a message from dart code to the |
| 10 // eventhandler. When receiving a message from the eventhandler the | 10 // eventhandler. When receiving a message from the eventhandler the |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 _closeHandler = callback; | 383 _closeHandler = callback; |
| 384 } | 384 } |
| 385 | 385 |
| 386 bool _isListenSocket() => false; | 386 bool _isListenSocket() => false; |
| 387 | 387 |
| 388 bool _isPipe() => _pipe; | 388 bool _isPipe() => _pipe; |
| 389 | 389 |
| 390 InputStream get inputStream() { | 390 InputStream get inputStream() { |
| 391 if (_inputStream === null) { | 391 if (_inputStream === null) { |
| 392 if (_handlerMap[_IN_EVENT] !== null || | 392 if (_handlerMap[_IN_EVENT] !== null || |
| 393 _handlerMap[_CLOSE_EVENT]) { | 393 _handlerMap[_CLOSE_EVENT] !== null) { |
| 394 throw new StreamException( | 394 throw new StreamException( |
| 395 "Cannot get input stream when socket handlers are used"); | 395 "Cannot get input stream when socket handlers are used"); |
| 396 } | 396 } |
| 397 _inputStream = new SocketInputStream(this); | 397 _inputStream = new SocketInputStream(this); |
| 398 } | 398 } |
| 399 return _inputStream; | 399 return _inputStream; |
| 400 } | 400 } |
| 401 | 401 |
| 402 OutputStream get outputStream() { | 402 OutputStream get outputStream() { |
| 403 if (_outputStream === null) { | 403 if (_outputStream === null) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 bool _seenFirstOutEvent = false; | 455 bool _seenFirstOutEvent = false; |
| 456 bool _closedRead = false; | 456 bool _closedRead = false; |
| 457 bool _closedWrite = false; | 457 bool _closedWrite = false; |
| 458 bool _pipe = false; | 458 bool _pipe = false; |
| 459 Function _clientConnectHandler; | 459 Function _clientConnectHandler; |
| 460 Function _clientWriteHandler; | 460 Function _clientWriteHandler; |
| 461 SocketInputStream _inputStream; | 461 SocketInputStream _inputStream; |
| 462 SocketOutputStream _outputStream; | 462 SocketOutputStream _outputStream; |
| 463 } | 463 } |
| 464 | 464 |
| OLD | NEW |