Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][asio] deadline_timer doesn't delays - async_wait invokes handler at once
From: Igor R (boost.lists_at_[hidden])
Date: 2009-01-29 16:06:50


>
> boost::asio::deadline_timer
> timer(socket_.io_service(),boost::posix_time::seconds(5));
> timer.async_wait(boost::bind(set_result, &timer_result, _1));
>

Does it work if you rewrite it as follows?

boost::asio::deadline_timer timer(socket_.io_service());
timer.expires_from_now(boost::posix_time::seconds(5));
timer.async_wait(boost::bind(set_result, &timer_result, _1));



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