An object representing an asynchronous I/O operation.
More...
#include <AsyncIOTask.h++>
An object representing an asynchronous I/O operation.
- Author
- Mark Lindner
◆ AsyncIOTask()
Construct a new AsyncIOTask.
The to collect the results of the task, either:
-
Periodically call isCompleted() until that method returns true, or
-
Call waitFor() to block until the operation completes.
◆ ~AsyncIOTask()
◆ cancel()
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.
- Exceptions
-
◆ getBytesTransferred()
size_t getBytesTransferred |
( |
| ) |
|
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().
- Returns
- The number of bytes that were transferred. Returns 0 if the operation is still in progress, or if its result has not yet been collected via a call to isCompleted().
◆ isCompleted()
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.
- Returns
- true if the task has completed; false if it is still in progress.
- Exceptions
-
◆ waitFor()
Wait for an asynchronous I/O task to complete.
- Parameters
-
timeout | The maximum amount of time to wait, in milliseconds. |
- Exceptions
-
◆ AsyncIOPoller
◆ Stream
The documentation for this class was generated from the following files: