Debugging synchronous applications is usually easier than debugging asynchronous applications. For a synchronous application, if it gets blocked, you'll just break into debug, and you'll get a picture of where you are (synchronous means sequential). However, when going asynchronous, events don't happen sequentially, so in case of a bug, it's really hard to track what happened.
To avoid this, first, you should delve deeply into co-routines. If implemented correctly, you should virtually have no problems at all.
Just in case you do, when it comes to asynchronous programming, Boost.Asio lends you a helping hand; Boost.Asio allows for handler tracking
, when the macro
BOOST_ASIO_ENABLE_HANDLER_TRACKING is defined. If so, Boost.Asio writes ...