![]() |
Home | Libraries | People | FAQ | More |
void on_some_event() { if (my_timer.expires_from_now(seconds(5)) > 0) { // We managed to cancel the timer. Start new asynchronous wait. my_timer.async_wait(on_timeout); } else { // Too late, timer has already expired! } } void on_timeout(const boost::asio::error& e) { if (e != boost::asio::error::operation_aborted) { // Timer was not cancelled, take necessary action. } }
Copyright © 2003 - 2006 Christopher M. Kohlhoff |