|
Boost Users : |
Subject: Re: [Boost-users] boost::asio - Can't get timeout on accept to work
From: Igor R (boost.lists_at_[hidden])
Date: 2010-02-18 10:18:10
> Â 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.
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