I would like to create a IOCP application to received TCP data, Once received, I will have to processing the data and write out the bytes partially. Understand that WSASend with IOCP can do the job. But I am worrying whether WSASend to the queue and does GetQueuedCompletionStatus synchronizely?. For Example:-
void processing_from_other_thread(...) {
...
DWORD state = still_doing1;
WSASend( ..,..,.., &state, .. );
DWORD state = still_doing2;
WSASend( ..,..,.., &state, .. );
DWORD state = still_doing3;
WSASend( ..,..,.., &state, .. );
DWORD state = Done;
PostCompletionQueue(....);
}
From the context above, will GetQueuedCompletionStatus getting them orderly?
GetQueuedCompletionStatus();
return still_doing1
GetQueuedCompletionStatus();
return still_doing2
GetQueuedCompletionStatus();
return still_doing3
GetQueuedCompletionStatus();
return Done
Continue
I just want to make sure the future design is correctly, I am afraid they are not orderly, For example, Return still_doing2 completed before still_doing1. The data sent might affected to client side.