|
-
October 18th, 2005, 04:15 AM
#1
Is Data Reorder in IOCP
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
-
October 18th, 2005, 05:52 AM
#2
Re: Is Data Reorder in IOCP
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 message
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.
- petter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|