 timer has already expired!
  }
}

void on_timeout(const boost::system::error_code&amp; e)
{
  if (e != boost::asio::error::operation_aborted)
  {
    // Timer was not cancelled, take necessary action.
  }
}
</pre>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
            The <code class="computeroutput">boost::asio::basic_waitable_timer::expires_after()</code> function
            cancels any pending asynchronous waits, and returns the number of a