| 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 | 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if (value is! int) { | 422 if (value is! int) { |
| 423 throw new FileIOException( | 423 throw new FileIOException( |
| 424 "List element is not an integer at index $j"); | 424 "List element is not an integer at index $j"); |
| 425 } | 425 } |
| 426 outBuffer[i] = value; | 426 outBuffer[i] = value; |
| 427 j++; | 427 j++; |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 var result = _writeList(outBuffer, outOffset, bytes); | 430 var result = _writeList(outBuffer, outOffset, bytes); |
| 431 if (result is OSError) { | 431 if (result is OSError) { |
| 432 _reportError(result, "Write failed"); |
| 432 // If writing fails we return 0 as the number of bytes and | 433 // If writing fails we return 0 as the number of bytes and |
| 433 // report the error on the error handler. | 434 // report the error on the error handler. |
| 434 result = 0; | 435 result = 0; |
| 435 _reportError(result, "Write failed"); | |
| 436 } | 436 } |
| 437 return result; | 437 return result; |
| 438 } | 438 } |
| 439 throw new SocketIOException("writeList failed - invalid socket handle"); | 439 throw new SocketIOException("writeList failed - invalid socket handle"); |
| 440 } | 440 } |
| 441 | 441 |
| 442 _writeList(List<int> buffer, int offset, int bytes) | 442 _writeList(List<int> buffer, int offset, int bytes) |
| 443 native "Socket_WriteList"; | 443 native "Socket_WriteList"; |
| 444 | 444 |
| 445 bool _isErrorResponse(response) { | 445 bool _isErrorResponse(response) { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 bool _seenFirstOutEvent = false; | 589 bool _seenFirstOutEvent = false; |
| 590 bool _pipe = false; | 590 bool _pipe = false; |
| 591 Function _clientConnectHandler; | 591 Function _clientConnectHandler; |
| 592 Function _clientWriteHandler; | 592 Function _clientWriteHandler; |
| 593 SocketInputStream _inputStream; | 593 SocketInputStream _inputStream; |
| 594 SocketOutputStream _outputStream; | 594 SocketOutputStream _outputStream; |
| 595 String _remoteHost; | 595 String _remoteHost; |
| 596 int _remotePort; | 596 int _remotePort; |
| 597 static SendPort _socketService; | 597 static SendPort _socketService; |
| 598 } | 598 } |
| OLD | NEW |