HttpWaitForDisconnect function (http.h)
The HttpWaitForDisconnect function notifies the application when the connection to an HTTP client is broken for any reason.
HTTPAPI_LINKAGE ULONG HttpWaitForDisconnect( [in] HANDLE RequestQueueHandle, [in] HTTP_CONNECTION_ID ConnectionId, [in] LPOVERLAPPED Overlapped );
A handle to the request queue that handles requests from the specified connection. A request queue is created and its handle returned by a call to the HttpCreateRequestQueue function.
Windows Server 2003 with SP1 and Windows XP with SP2: The handle to the request queue is created by the HttpCreateHttpHandle function.
For asynchronous calls, set pOverlapped to point to an OVERLAPPED structure; for synchronous calls, set it to NULL.
A synchronous call blocks until the connection is broken, whereas an asynchronous call immediately returns ERROR_IO_PENDING and the calling application then uses GetOverlappedResult or I/O completion ports to determine when the operation is completed. For information about using OVERLAPPED structures for synchronization, see Synchronization and Overlapped Input and Output.
If the function succeeds, the return value is NO_ERROR.
If the function is used asynchronously, a return value of ERROR_IO_PENDING indicates that the next request is not yet ready and is retrieved later through normal overlapped I/O completion mechanisms.
If the function fails, the return value is one of the following error codes.
||One or more of the supplied parameters is in an unusable form.|
||A system error code defined in WinError.h.|
|Minimum supported client||Windows Vista, Windows XP with SP2 [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|