0

Hello guys, I am having trouble getting an asyncronous communications set up using overlapping. Actually to be more specific I am having problems with using httpWaitForDisconnect to work as async.
Using the code below I am able to enter the function, but it is in a blocking state which defeats all the purposes of me trying to use this function in the first place.
The Code:

HANDLE hQueue;
HTTP_REQUEST* pHttpData;
ULONG ulReturn = 0;

OVERLAPPED* ovlp;
	ZeroMemory(&ovlp, sizeof(&ovlp));
ulReturn = HttpReceiveHttpRequest(hQueue, RequestId, 0, pHttpData, dwBufferSize, &dwSizeReceived, ovlp);
RequestId = pHttpData->RequestId;
		if (ulReturn == ERROR_INVALID_PARAMETER)  {
			AddToTraceLog("HttpReceiveHttpRequest : Invalid Parameter");
		}

		AddToTraceLog("Going into the disconnect");
		ulReturn = HttpWaitForDisconnect(hQueue, pHttpData->ConnectionId, ovlp);
		switch(ulReturn)
		{
		case NO_ERROR:
			AddToTraceLog("User Has Disconnected...");
			break;
		case ERROR_IO_PENDING:
			AddToTraceLog("IO Pending, next request not ready...");
			break;
		case ERROR_INVALID_PARAMETER:
			AddToTraceLog("Error" + getLastError());
			break;
		}

Thank you in advance.

Edited by JenniLei: n/a

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by JenniLei
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.