$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Boost asio deadline_timer, bug?
From: Arash Partow (arash_at_[hidden])
Date: 2011-08-19 04:33:03
Allan Nielsen wrote:
> Is this a bug, or am I doing something wrong?
>
 >
No bug here (I think), as per [1], a cancelled operation will be invoked 
with an error code - this is so one can discern between a normal 
invocation and a cancel or error.
Your handler could be updated like so:
void handler(const boost::system::error_code &ec)
{
    if (!ec)
    {
       cout << "Forbidden handler" << endl;
       assert(0);
    }
    else
       cout << "Timer1 interrupted by someone." << endl;
}