Yes, I truly understand this but for some weired reason this doesn't work at all. In my case I launch the run function in the constructor of the main class right after the sender class had been instantiated:
SJ::SJ(){
/// SENDER INIT dFC->mySender = new sender(this);
boost::thread t = boost::thread(boost::bind(&boost::asio::io_service::run, &dFC->io_service)); t.join();
// OR dFC->io_service.run(); }
In there anything wrong with this ?
It seems that you call io_serivce::run() before any async operation was issued. In such a case, run() just exits immediately, as I explained in one of my previous comments. In order to avoid such a behavior, associate io_service::work object with this io_service: http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference/io_servic... (scroll down) In general, it's highly recommended to read the Asio documentation - all these issues are described there.