Networking TS

PrevUpHomeNext

basic_waitable_timer::cancel

Cancel any asynchronous operations that are waiting on the timer.

std::size_t cancel();

This function forces the completion of any pending asynchronous wait operations against the timer. The handler for each cancelled operation will be invoked with the std::experimental::net::v1::error::operation_aborted error code.

Cancelling the timer does not change the expiry time.

Return Value

The number of asynchronous operations that were cancelled.

Exceptions

std::system_error

Thrown on failure.

Remarks

If the timer has already expired when cancel() 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