Boost Users :
Subject: Re: [Boost-users] Asio timer - how to restart it?
From: Peleg (pelegsh_at_[hidden])
Date: 2008-10-23 12:42:17
Igor R wrote:
>> boost::asio::deadline_timer timer(io,
>> boost::thread thread(boost::bind(&boost::asio::io_service::run,
> Note that you set the timer timeout to be 5 second, but wait 3 second
>> cout << second_clock::local_time() << " Restarting timer" << endl;
> You just change the timeout here. To restart the timer you have to
> call timer.async_wait().
> By the way, note that the timer is not threadsafe so I'm not sure it's
> legal to restart it here or to change its timeout this way.
> Boost-users mailing list
Thanks, that's it, now how do I filter only successful timer triggers?
I added the following line to on_time_out():
cout << "Error #" << error << ": " << error.message() << endl;
And successful call resulted the following output:
Error #system:0: The operation completed successfully
but I failed to find the correct error_code value I've tried:
if(error == boost::asio::error::success)
if(error == boost::system::error::success)
but non of them is valid, what is the valid success condition?
-- View this message in context: http://www.nabble.com/Asio-timer---how-to-restart-it--tp20128401p20134911.html Sent from the Boost - Users mailing list archive at Nabble.com.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net