$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Asio timer - how to restart it?
From: Igor R (boost.lists_at_[hidden])
Date: 2008-10-23 13:45:34
> Thanks, that's it, now how do I filter only successful timer triggers?
> I added the following line to on_time_out():
"For each call to async_wait(), the supplied handler will be called
exactly once. The handler will be called when:
  * The timer has expired.
  * The timer was cancelled, in which case the handler is passed the
error code boost::asio::error::operation_aborted."
So usually you test it like this:
void handler(const boost::system::error_code &err)
{
  if (err != boost::asio::error::operation_aborted)
  {
    // do what you want
  }
  //or:
  if (err && err != boost::asio::error::operation_aborted)
  {
    //...
  }
}