| 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 #ifndef RUNTIME_BIN_EVENTHANDLER_WIN_H_ | 5 #ifndef RUNTIME_BIN_EVENTHANDLER_WIN_H_ |
| 6 #define RUNTIME_BIN_EVENTHANDLER_WIN_H_ | 6 #define RUNTIME_BIN_EVENTHANDLER_WIN_H_ |
| 7 | 7 |
| 8 #if !defined(RUNTIME_BIN_EVENTHANDLER_H_) | 8 #if !defined(RUNTIME_BIN_EVENTHANDLER_H_) |
| 9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead. | 9 #error Do not include eventhandler_win.h directly; use eventhandler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // Read data from a buffer which has been received. It will read up | 58 // Read data from a buffer which has been received. It will read up |
| 59 // to num_bytes bytes of data returning the actual number of bytes | 59 // to num_bytes bytes of data returning the actual number of bytes |
| 60 // read. This will update the index of the next byte in the buffer | 60 // read. This will update the index of the next byte in the buffer |
| 61 // so calling Read several times will keep returning new data from | 61 // so calling Read several times will keep returning new data from |
| 62 // the buffer until all data have been read. | 62 // the buffer until all data have been read. |
| 63 int Read(void* buffer, int num_bytes); | 63 int Read(void* buffer, int num_bytes); |
| 64 | 64 |
| 65 // Write data to a buffer before sending it. Returns the number of bytes | 65 // Write data to a buffer before sending it. Returns the number of bytes |
| 66 // actually written to the buffer. Calls to Write will always write to | 66 // actually written to the buffer. Calls to Write will always write to |
| 67 // the buffer from the begining. | 67 // the buffer from the beginning. |
| 68 int Write(const void* buffer, int num_bytes); | 68 int Write(const void* buffer, int num_bytes); |
| 69 | 69 |
| 70 // Check the amount of data in a read buffer which has not been read yet. | 70 // Check the amount of data in a read buffer which has not been read yet. |
| 71 int GetRemainingLength(); | 71 int GetRemainingLength(); |
| 72 bool IsEmpty() { return GetRemainingLength() == 0; } | 72 bool IsEmpty() { return GetRemainingLength() == 0; } |
| 73 | 73 |
| 74 Operation operation() const { return operation_; } | 74 Operation operation() const { return operation_; } |
| 75 SOCKET client() const { return client_; } | 75 SOCKET client() const { return client_; } |
| 76 char* GetBufferStart() { return reinterpret_cast<char*>(&buffer_data_); } | 76 char* GetBufferStart() { return reinterpret_cast<char*>(&buffer_data_); } |
| 77 int GetBufferSize() const { return buflen_; } | 77 int GetBufferSize() const { return buflen_; } |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 bool shutdown_; | 575 bool shutdown_; |
| 576 HANDLE completion_port_; | 576 HANDLE completion_port_; |
| 577 | 577 |
| 578 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); | 578 DISALLOW_COPY_AND_ASSIGN(EventHandlerImplementation); |
| 579 }; | 579 }; |
| 580 | 580 |
| 581 } // namespace bin | 581 } // namespace bin |
| 582 } // namespace dart | 582 } // namespace dart |
| 583 | 583 |
| 584 #endif // RUNTIME_BIN_EVENTHANDLER_WIN_H_ | 584 #endif // RUNTIME_BIN_EVENTHANDLER_WIN_H_ |
| OLD | NEW |