Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][asio] deadline_timer doesn't delays -async_wait invokes handler at once
From: tomasz jankowski (tomasz_jacek_at_[hidden])
Date: 2009-01-30 02:54:28


Dnia 29-01-2009 o godz. 22:06 Igor R napisał(a):

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));

yes, it works.
thanks a lot Igor.

tom




----------------------------------------------------
Kate Winslet i Leonardo DiCaprio znowu razem na ekranie!
DROGA DO SZCZĘŚCIA - w kinach od 30 stycznia.
Zobacz zwiastun: http://klik.wp.pl/?adr=http://corto.www.wp.pl/as/szczescie.html&sid=624

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