Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::asio::deadline_timer cancel and expires_from_now
From: Juan Ramírez (jramirez.uy_at_[hidden])
Date: 2017-05-09 02:02:36


Hi!

The documentation
<http://www.boost.org/doc/libs/1_64_0/doc/html/boost_asio/reference/basic_waitable_timer/expires_from_now/overload2.html>
stands that any pending operations will be cancelled, just like calling
timer.cancel().

Have in mind that the handler for the cancelled operation will be called
with error_code set to boost::asio::error::operation_aborted.

Best regards
Juan

On Mon, May 8, 2017 at 8:43 PM, jupiter via Boost-users <
boost-users_at_[hidden]> wrote:

> Hi,
>
> Is it necessary to call the timer.cancel() before timer.expires_from_now?
> I think it is not just unnecessary, it will be a bug to call the
> timer.cancel() before timer.expires_from_now, I think that will run the
> cancel if the previous timer is not expired, is it correct?
>
> Thank you
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
Juan
:wq


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net