(the question is copied from msdn forum)
MSDN says this:
If you are using I/O completion ports, be aware that the order of calls made to WSASend is also the order in which the buffers are populated. WSASend should not be called on the same socket simultaneously from different threads, because it can result in an unpredictable buffer order.
Ok... but if I don't care about this order and also don't care about the order I will receive it on the other side... can I use it then? Is it safe to call WSASend from multiple threads? And will the packages be delivered how I pass them (maybe ordered differently, but complete) ??
E.g. -> I send [12a], [34b], [11c] and [223d] ... ([] marks the unit I pass to WSASend in one call) will I receive then e.g. 34b, 11c, 12a, 223d ? Or could it crash? Or could I receive things like 2a, 34b, 7a, 5c, ...
so, maybe the question should be -> is it thread safe? and is it atomic? (I'm talking about WSASend used with IOCPs, so OVERLAPPED)