Peter Chapman:
I'm under the impression that queueing several async reads will allow the OS to fill one buffer while the read handler for a previous read is still executing.
...
On Linux this technique works fine for multiple pending reads. On Windows, it sometimes leads to handlers being called in the wrong order.
Following up my own post for the benefit of the archives: I was calling tcp::socket::async_receive in quick succession with the buffers A, B, C, and D in that order. The buffers were eventually being filled with stream data that, when reassembled in the order A, B, C, D was correct. However, the receive handlers were (sometimes) being called out-of-order (e.g. D, A, B, C). This is easy enough to work around once you know what's going on (i.e. that the order of async_receive calls is important, and that the order of their callbacks is not reliable) I don't think I could have figured this out from the documentation, hence my follow-up post here.