Boost logo

Boost :

Subject: Re: [boost] [asio] timer cancelling
From: Ralf Globisch (rglobisch_at_[hidden])
Date: 2011-03-22 05:21:10


Robert, FYI, I think it might be better to post asio related queries to the dedicated asio mailing list: https://lists.sourceforge.net/lists/listinfo/asio-users

Regards,
Ralf

>>> "Mr. Robert G Palmer Jr." 03/21/11 3:28 PM >>>
boost 1.45.0
WinXP SP3

What is the difference between boost::deadline_timer.cancel() and the cancellation that happens due to boost::deadline_timer.expires_from_now()?

I'm doing an async_read_some() inside of a wrapper function I have written (based on http://lists.boost.org/Archives/boost/2007/04/120339.php). I have a read handler and a timer handler (I want the bytes read value and could probably combine the two handlers into one with the appropriate modification to the bind call). The read handler works, and then I cancel the timer, but the NEXT TIME I call the wrapper function, the timer hander fires with a boost::asio::error::operation_aborted. The timer object is local to the wrapper function, but the io_service is not, it is passed in, so it seems the io_service is holding onto the timer completion handler AND the fact that it was cancelled.

Is there a way to clean this out before exiting my wrapper function?

Is the 'expires_from_now()' calling the timer handler or is it the first call to run_one()?

Thanks,

-- 
Robert G. Palmer, Jr.
robert.palmer_at_[hidden]
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk