Is there any reorder of Data during WSARECV [usingIOCP],
If my messge is larger than socket Buffer, e.g. It will take 5 REC to get data [Chunk1,Chunk2....,Chunk5]
Is there any possibilty Chunk2 came before Chunk1? If yes how to cancatinate message
Printable View
Is there any reorder of Data during WSARECV [usingIOCP],
If my messge is larger than socket Buffer, e.g. It will take 5 REC to get data [Chunk1,Chunk2....,Chunk5]
Is there any possibilty Chunk2 came before Chunk1? If yes how to cancatinate message
If you issue multiple overlapped reads (FileRead etc) on a socket then the "bufferes" are filled in the same order as they are issued (first one first), but they may complete in a different order. That is, the second recv (containing the second buffer) may complete before the first one.Quote:
Is there any possibilty Chunk2 came before Chunk1?
One way to "make it right" is to tag every read ops with an id (an increasing integer added to the overlapped structure). When the read op completes, check the id... this way know in what order the "buffers" were issued and thus in what order they should be concatenated.Quote:
If yes how to cancatinate message
- petter