
2 Apr
2012
2 Apr
'12
3:07 p.m.
Hi all, reading the manual I see that ip::tcp::socket thread safety on shared object is not safe. In my application I'm using: ip::tcp::socket::async_connect boost::asio::async_read( ip::tcp::socket , ...) the application queue an async_read or an async_connect inside the receiving handler (in case of error it retry the connection).
From an external thread (to stop the reception) I perform a:
ip::tcp::socket::shutdown ip::tcp::socket::close do I have realy to synchronize the async_connect/async_read with shutdown/close ? Using a mutex to protect those calls seems an overkill, may be shutdown and close can be called in concurrency with async_connect/async_read and the documentation is just conservative? Regards Gaetano Mendola