Effect of exceptions thrown from handlers

If an exception is thrown from a handler, the exception is allowed to propagate through the throwing thread's invocation of asio::io_service::run(), asio::io_service::run_one(), asio::io_service::poll() or asio::io_service::poll_one(). No other threads that are calling any of these functions are affected. It is then the responsibility of the application to catch the exception.

After the exception has been caught, the asio::io_service::run(), asio::io_service::run_one(), asio::io_service::poll() or asio::io_service::poll_one() call may be restarted without the need for an intervening call to asio::io_service::reset(). This allows the thread to rejoin the io_service's thread pool without impacting any other threads in the pool.

Example
 asio::io_service io_service;
 ...
 for (;;)
 {
   try
   {
     io_service.run();
     break; // run() exited normally
   }
   catch (my_exception& e)
   {
     // Deal with exception as appropriate.
   }
 }

Generated on Sun May 25 00:20:19 2008 by  doxygen 1.5.6