boost::asio::io_service::post and boost::asio::deadline_timer
I am getting boost:asio::error::operation_aborted error codes for an unknown reason in my handlers. No where did a cancel or reset occur, nor was the deadline_time or the io_service destroyed. Does anyone know if I may post to the same io_service a deadline_timer was constructed with or if they will interfere with eachother? May I post multiple times to the deadline timer calling back different methods? I can't imagine why the abort would show up other than I am taking something for granted.
I am getting boost:asio::error::operation_aborted error codes for an unknown reason in my handlers. No where did a cancel or reset occur, nor was the deadline_time or the io_service destroyed.
Note that if your timer has pending wait operations, and you call expires_at() or expires_from_now(), any pending asynchronous wait operations will be implicitly cancelled -- any you'll get operation_aborted error in the appropriate handlers.
Does anyone know if I may post to the same io_service a deadline_timer was constructed with or if they will interfere with eachother?
Yes, of course you may. You can use a single io_service for everything.
May I post multiple times to the deadline timer calling back different methods?
Could you clarify what you mean?
Igor R
May I post multiple times to the deadline timer calling back different methods?
Could you clarify what you mean?
I mean now = current time "Make biscuits 30 seconds from now." "Clean the car 10 seconds from now." "Ride your bike 45 seconds from now." Or does posting to the timer before it is "expired" interfere with the first request?
participants (2)
-
Christopher
-
Igor R