some OVERLAPS using WSASend not returning in a timely manner using GetQueuedCompletionStatus?

Posted by Geoffrey on Stack Overflow See other posts from Stack Overflow or by Geoffrey
Published on 2009-07-17T19:30:29Z Indexed on 2010/12/24 5:54 UTC
Read the original article Hit count: 272

Filed under:
|
|

Background: I'm using CreateIoCompletionPort, WSASend/Recv, and GetQueuedCompletionStatus to do overlapped socket io on my server. For flow control, when sending to the client, I only allow several WSASend() to be called when all pending OVERLAPs have popped off the IOCP.

Problem: Recently, there are occassions when the OVERLAPs do not get returned to the IOCP. The thread calling GetQueuedCompletionStatus does not get them and they remain in my local pending queue. I've verified that the client DOES receive the data off the socket and the socket is connected. No errors were returned when the WSASend() calls were made. The OVERLAPs simply "never" come back without an external stimulus like the following:

  1. Disconnecting the socket from the client or server, immediately allows the GetQueuedCompletionStatus thread to retrieve the OVERLAPs
  2. Making additional calls to WSASend(), sometimes several are needed, before all the OVERLAPs suddenly pop off the queue.

Question: Has anyone seen this type of behavior? Any ideas on what is causing this?

Thanks, Geoffrey

© Stack Overflow or respective owner

Related posts about c++

Related posts about Windows