18 Feb
2010
18 Feb
'10
3:18 p.m.
try { boost::asio::deadline_timer mytimer(ioService);
acceptor.async_accept(socket, boost::bind(CProtobufSocket::HandleAccept, boost::asio::placeholders::error, result)); mytimer.expires_from_now(timeout); mytimer.async_wait(boost::bind(CProtobufSocket::Close, &acceptor));
In your real code do you also define the timer as a local object? If so, it's destroyed by the end of the scope.