Boost logo

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