There is one aspect of timers in asynchronous connections that I want to know if I understand correctly.
Suppose we set a timer before performing a read operation that includes a handler and then run()io_service.
As I understand it, io_service ends as soon as the manager ends after the call, which can happen for two reasons:
a) the read operation is complete.
b) the timer has reached its limit.
Assume that the first (a) condition is satisfied, and the read operation completed before the timer ends.
Question: what happens with this timer? Do I need to finish this. Let's say
dTimer_.expires_from_now (boost::posix_time::seconds(0));
after the io_service.run()?
Can you reset to a new interval, if necessary, reuse the same timer object for another read operation?
reset() io_service run() ?