Is the order that data is sent to a socket with boost::asio guaranteed at all?
That is, I'm making multiple calls to
boost::asio::async_write(socket, buffer, completionHandler)
and I'm seeing some odd behaviour where the client isn't apparently receiving the data I think I'm sending, so I'm wanting to make sure that this is doing what I hope it's doing. Note that I'm not waiting for the completion handler to be called between each write, I'm just firing a bunch of async_write calls and naively expecting the data to be written to the socket in the same order.
The strand documentation in asio says:
Where there is a single chain of asynchronous operations associated with a connection (e.g. in a half duplex protocol implementation like HTTP) there is no possibility of concurrent execution of the handlers. This is an implicit strand.
I take this to mean that using a strand won't change anything, as the socket provides an implicit strand.
The strand documentation in general talks about strictly sequential invocation of event handlers. However it's not clear to me whether the data written to the connection will be written in the order in which I make calls to async_write.
Is the order that data is written to the socket guaranteed?