I have a boost::asio::ip::tcp::socket that I want to write to. Can I have multiple outstanding async_write() requests for a single socket? Are the writes performed in the order in which they are submitted? Or is this undefined behavior?
How about multiple async_read() requests on the same socket?
Do not do multiple. Make your own simple queue for each connection and be happy. I'm acquainted with this problem and got quite bad behavior when using multiple async_write's at once. Of course, you still can run async_read and async_write together for one connection. Of course, you still can run multiple async_read's, async_write's, when you have multiple connections. Hope this helps. BTW, you can find in boost archives two discussions on similar topic.