
After network cable is unplugged, a call to GetAllWI does not call write_wis_for_oow_req. I can see an exit thread message in Visual Studio output window.
io_service::run() exits, if io_service has no more work. Eg., all your read/write handlers have been called, and no new async. operation were enqueued. You can use a "work" class to prevent io_service::run() from exiting: http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/io_servic...
1. It would be great help if someone can suggest a way to handle this scenario. Is there a way to know this io_service::run has exited.
You can call the run() method from your own function:
//....
void do_run(io_service *io)
{
io->run();
std::cout << "io_service::run ended" < My program needs to handle this scenario and Client should be able to detect network problem and reconnect. Take a look at this thread:
http://old.nabble.com/-asio--Detecting-tcp-peer-disconnection-td27357792.htm...