boost::asio::deadline_timer cancel and expires_from_now
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
Hi! The documentation http://www.boost.org/doc/libs/1_64_0/doc/html/boost_asio/reference/basic_wai... 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@lists.boost.org> 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@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Juan :wq
Thanks Juan for the confirmation.
On Tue, May 9, 2017 at 12:02 PM, Juan Ramírez
Hi!
The documentation http://www.boost.org/doc/libs/1_64_0/doc/html/boost_asio/reference/basic_wai... 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@lists.boost.org> 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@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Juan :wq
participants (2)
-
Juan Ramírez
-
jupiter