$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] blocking read after async connect
From: Igor R (boost.lists_at_[hidden])
Date: 2010-03-22 05:39:32
> I find that unless I call io_service::stop() , I can't perform a asio::read().
> It's actually on a thread and I'm having difficulty seeing what the
> exception thrown exactly is ('thread called terminate')
Use your own thread function to see what happened to your io_service:
void do_run(io_service *io)
{
try
{
io->run();
std::cout << "io_service::run ended" <<std::eol;
}
catch(std::exception &e)
{
std::cout << e.what() <<std::eol;
}
catch(...)
{
std::cout << "some other exception" <<std::eol;
}
}
//...
thread t(&do_run, &io_service);