basic_deadline_timer::cancel (2 of 2 overloads)

| Home | Libraries | People | FAQ | More

##### basic_deadline_timer::cancel (2 of 2 overloads)

Cancel any asynchronous operations that are waiting on the timer.

    std::size_t cancel(
        boost::system::error_code & ec);

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 boost::asio::error::operation_aborted error code.

Cancelling the timer does not change the expiry time.

###### Parameters

ec

  Set to indicate what error occurred, if any.

###### Return Value

The number of asynchronous operations that were cancelled.