I understood that calling boost::asio::ip::tcp::socket::async_receive (or boost::asio::ip::tcp::socket::async_send) two times may result in a bad behavior..
Is it OK if i call boost::asio::ip::tcp::socket::async_recive and boost::asio::ip::tcp::socket::async_send at the same time?
I am going to have 2 or more threads running the boost::asio::run so you need to take that into account..
Thanks
This has to be OK. How else would you perform full duplex async communications on a single service? You need a receive outstanding at all times for incoming data.
The Boost docs indicate only that each of
async_readandasync_writemust be called serially. For example, forasync_read:The docs for
socketare not specific on this point, it’s true.