Boost logo

Boost Users :

Subject: Re: [Boost-users] More problems with boost::asio and async_read
From: Allan Nielsen (a_at_[hidden])
Date: 2011-08-10 01:57:29


Just for the record, I finally found the problem. The async_read
operation needs to be canceled just like the timer:

   while(1) {
       io.reset();
       io.poll_one(ec);

       if ( read_result ) {
           timer.cancel();
           return;

       } else if ( timer_result ) {
           stream.cancel();
           throw std::runtime_error("timeout");
       }
   }
}

--
Allan

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