niXman
2012-04-14 07:49:19 UTC
This simple code does not call the handler print () if I change the time back.
Is this normal?
How can I fix this behavior?
#include <iostream>
#include <boost/asio.hpp>
void print(const boost::system::error_code& /*e*/) {
std::cout << "Hello, world!" << std::endl;
}
int main() {
boost::asio::io_service io;
boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
t.async_wait(print);
io.run();
return 0;
}
http://liveworkspace.org/code/5e35baafe00a0a7a47f51347a92d9110
Thanks.
Is this normal?
How can I fix this behavior?
#include <iostream>
#include <boost/asio.hpp>
void print(const boost::system::error_code& /*e*/) {
std::cout << "Hello, world!" << std::endl;
}
int main() {
boost::asio::io_service io;
boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
t.async_wait(print);
io.run();
return 0;
}
http://liveworkspace.org/code/5e35baafe00a0a7a47f51347a92d9110
Thanks.
--
Regards,
niXman
Regards,
niXman