I am aware that one can run async_send and async_receive operations concurrently on TCP and UDP sockets. But what is the expected behavior in these situations:
- calling two async_send operations concurrently on an UDP socket.
- calling two async_receive operations concurrently on an UDP socket.
- calling two async_send operations concurrently on a TCP socket.
- calling two async_receive operations concurrently on a TCP socket.
I'm mainly interested in the first case; since UDP doesn't necessarily preserve the order of sent packets, I don't care much if they are sent in order different from the one async_send was invoked.
The same thing happens as would happen without Boost ASIO:
Both datagrams will be sent.
It is arbitrary which operation will receive the next datagram, but both operations will behave normally.
The data may interleave unpredictably.
The data may interleave unpredictably.