End Google Ads 201810 - BS.net 01 --> My application experiences the problem where occasionally, two packets appear to arrive out of order. Since I'm using TCP, this must be impossible at the protocol level, so I think the problem must lie with my implementation of the async model.

The pseudo code of my implementation is below. Are there any general pointers someone can mention that might be wrong with my model?

Is there anything wrong with issuing subsequent reads directly from the read-completion handler?

Begin Read Issue asynchronous read if Read completes synchronously, directly call Read Completion function Read Complete Function call EndRead to determine number of bytes read write receive buffer to my stream process stream call Begin Read to issue another read


The difficult we do right away...
...the impossible takes slightly longer.