Problem with WSAWaitForMultipleEvents does not apparantly cancel its event
hWSADataRecv = WSACreateEvent();
intRetVal = WSAEventSelect(intUDPDataSocket, hWSADataRecv, FD_READ);
intRetVal = CmtScheduleThreadPoolFunction
(hEtherThreadPool, etherDataPortRecv , 0, ðerDataPortRecvThreadFunctionID);
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 between Thanks,
archieb@voxtel-inc.com

