You might also consider using Boost.Context to manage Asio state. I think there are Context examples dealing with Asio.