An object representing an asynchronous I/O operation. More...
#include <AsyncIOTask.h++>
Public Member Functions | |
| AsyncIOTask () | |
| Construct a new AsyncIOTask. | |
| ~AsyncIOTask () | |
| Destructor. | |
| bool | isCompleted () throw (IOException, InterruptedException) |
| Determine if the asynchronous I/O task has completed (either successfully or with an error); and, if so, determine the result of the operation. | |
| void | cancel () throw (IOException) |
| Attempt to cancel the asynchronous I/O task. | |
| void | waitFor (timespan_ms_t timeout) throw (IOException, InterruptedException) |
| Wait for an asynchronous I/O task to complete. | |
| size_t | getBytesTransferred () throw () |
| Get the number of bytes transferred by the I/O task. | |
Friends | |
| class | Stream |
| class | AsyncIOPoller |
An object representing an asynchronous I/O operation.
| AsyncIOTask | ( | ) |
Construct a new AsyncIOTask.
The to collect the results of the task, either:
| ~AsyncIOTask | ( | ) |
Destructor.
| void cancel | ( | ) | throw (IOException) |
Attempt to cancel the asynchronous I/O task.
Whether a given I/O task is actually cancellable is implementation-defined. Note that due to limitations in the Win32 API, on Windows versions prior to Vista this call will cancel all pending asynchronous I/O operations for the stream associated with this task.
| IOException | If the task could not be cancelled. |
| size_t getBytesTransferred | ( | ) | throw () |
Get the number of bytes transferred by the I/O task.
This method should only be called after it has been determined that the task has completed via a call to isCompleted().
| bool isCompleted | ( | ) | throw (IOException, InterruptedException) |
Determine if the asynchronous I/O task has completed (either successfully or with an error); and, if so, determine the result of the operation.
If the I/O task involved a ByteBuffer, that buffer's position is bumped by the number of bytes that were transferred.
| IOException | If an I/O error occurred during the operation. | |
| InterruptedException | If the I/O task was cancelled via a call to cancel(). |
| void waitFor | ( | timespan_ms_t | timeout | ) | throw (IOException, InterruptedException) |
Wait for an asynchronous I/O task to complete.
| timeout | The maximum amount of time to wait, in milliseconds. |
| TimeoutException | If the operation times out. | |
| IOException | If an I/O error occurred during the operation. | |
| InterruptedException | If the I/O task was cancelled via a call to cancel(). |
friend class AsyncIOPoller [friend] |
friend class Stream [friend] |
1.6.3