Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check if boost::deadline_timer is active

any way to check if deadline_timer is active? e.g. if it's in async_wait state and wasn't cancelled?

like image 475
Andriy Tylychko Avatar asked Feb 03 '23 23:02

Andriy Tylychko


1 Answers

The handler for the timeout will be called with an error condition if the timer was canceled (as well as a normal timeout). So could you not simply set a bool before calling async_wait and then reset that in the handler if the error condition is set?

like image 168
Nim Avatar answered Feb 05 '23 18:02

Nim