
9 Mar
2009
9 Mar
'09
10:07 a.m.
Rules are:
- first start do_read(), - then start the thread - after termination of the thread an io_service_.reset() is mandatory. Otherwise subsequent thread starts lead to spurious behaviour. This was not clear to me and I dislike this behaviour ...
ASIO reference explicitly states that you must call io_service::reset() before subsequent call to io_service::run(). However, you didn't have to exit the thread that runs io_service::run() - this's just matter of design. In the asio examples you can find other design choices.