Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext
basic_deadline_timer::cancel_one (1 of 2 overloads)

Cancels one asynchronous operation that is waiting on the timer.

std::size_t cancel_one();

This function forces the completion of one pending asynchronous wait operation against the timer. Handlers are cancelled in FIFO order. The handler for the cancelled operation will be invoked with the boost::asio::error::operation_aborted error code.

Cancelling the timer does not change the expiry time.

Return Value

The number of asynchronous operations that were cancelled. That is, either 0 or 1.

Exceptions

boost::system::system_error

Thrown on failure.

Remarks

If the timer has already expired when cancel_one() is called, then the handlers for asynchronous wait operations will:

These handlers can no longer be cancelled, and therefore are passed an error code that indicates the successful completion of the wait operation.


PrevUpHomeNext