I’m developing a Windows IOCP server and need to accurately detect when a client enters a zero window state. Specifically, I want to understand how the server can identify this condition when attempting to send data using WSASend() and processing the completion status in the worker thread using GetQueuedCompletionStatus() (GQCS).
I’ve attempted to send data using WSASend() when I suspect a client is in a zero window state. I’m expecting to receive a specific error code or completion status that would indicate the zero window condition. However, I’m unsure about the exact mechanism for detecting this state and what error codes or return values I should look for in the IOCP worker thread. My current implementation involves:
- Calling WSASend() to transmit data
- Using GetQueuedCompletionStatus() in the worker thread
- Checking the return values and potential error codes
I want to reliably distinguish between a genuine zero window state and other network communication issues.