Problem with WSAWaitForMultipleEvents does not apparantly cancel its event

I use LabWindowsCVI version 8.0.1. I set up an event with the lines

hWSADataRecv = WSACreateEvent();
intRetVal = WSAEventSelect(intUDPDataSocket, hWSADataRecv, FD_READ);
intRetVal = CmtScheduleThreadPoolFunction
(hEtherThreadPool, etherDataPortRecv , 0, &etherDataPortRecvThreadFunctionID);
and then in the thread the lines are used:

while(intQuitting == 0)
{

if((dwEvent = WSAWaitForMultipleEvents(1, hWSADataRecv, FALSE, 100,
FALSE)) == WSA_WAIT_EVENT_0)
{
if((intNumBytesRecv = recvfrom(intUDPDataSocket,
&ucDataBuf0[intBufferPosition], strBufLen, 0,
(LPSOCKADDR)&AddrDestData, &fromSize)) < 0)
{
etc.

This starts fine and waits for an incomming packet.
As soon as the first packt arrives WSAWaitForMultipleEvents fires as fast as it can and
recvfrom emits error 10035 (WSAWOULDBLOCK). The socket has been set to non
blocking by WSAEventSelect.

In Sockets Help under WSAWaitForMultipleEvents, the comment below occurs:

no further actions are taken for that

network event until the application makes the function call that implicitly

reenables the setting of that network event and signaling of the associated

event object.

What function call can I make to reset the event?

I am nervous that there is a disconnect betweenWSAWaitForMultipleEvents and LabWindowsCVI. Can you help or point me in the right direction,

Thanks,
archieb@voxtel-inc.com

[1533 byte] By [ArchieBarter] at [2008-2-6]
# 1

WSACreateEvent creates manual reset events. That is, it does a CreateEvent(NULL, TRUE, FALSE, NULL).

WSAResetEvent will reset the event back to a non-signaled state.

AnthonyJones-MSFT at 2007-9-4 > top of Msdn Tech,Windows Networking Development,Winsock Kernel (WSK)...