And now, for the fun (and hard) part, lets go asynchronous!
When checking out the diagrams, always understand that Boost.Asio means an asynchronous call performed by Boost.Asio. For instance,
on_read() indicates the logical flow from
on_read(), but you will never know the time it takes to get to
on_read(), you only know that you'll get there.
Things are a bit more complicated now but are definitely manageable. And you'll have an application that doesn't block!
You should already be familiar with the following code:
#define MEM_FN(x) boost::bind(&self_type::x, ...