Click to See Complete Forum and Search --> : Is Data Reorder in IOCP


madhusudankapoor
October 18th, 2005, 04:15 AM
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

wildfrog
October 18th, 2005, 05:52 AM
Is there any possibilty Chunk2 came before Chunk1?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.

If yes how to cancatinate messageOne 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.

- petter