Ignore:
Timestamp:
Jul 7, 2001, 4:29:41 PM (24 years ago)
Author:
achimha
Message:

implemented WSAEventSelect

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/asyncapi.cpp

    r6196 r6201  
    1 /* $Id: asyncapi.cpp,v 1.10 2001-07-07 10:44:08 achimha Exp $ */
     1/* $Id: asyncapi.cpp,v 1.11 2001-07-07 14:29:40 achimha Exp $ */
    22
    33/*
     
    731731//******************************************************************************
    732732//******************************************************************************
     733int WSAEnumNetworkEventsWorker(SOCKET s, WSAEVENT hEvent, LPWSANETWORKEVENTS lpEvent)
     734{
     735   PASYNCTHREADPARM pThreadInfo;
     736
     737   asyncThreadMutex.enter();
     738   pThreadInfo = FindAsyncEvent(s);
     739   if (pThreadInfo)
     740   {
     741        // TODO return correct errors!!!
     742        for (int i = 0; i < FD_MAX_EVENTS; i++)
     743        {
     744           lpEvent->iErrorCode[i] = 0;
     745        }
     746
     747        lpEvent->lNetworkEvents = pThreadInfo->u.asyncselect.lEventsPending;
     748
     749        // TODO is this correct? API says they're cleared
     750        pThreadInfo->u.asyncselect.lEventsPending = 0;
     751   }
     752   asyncThreadMutex.leave();
     753   if (!pThreadInfo)
     754   {
     755      dprintf(("no async registration for socket %x", s));
     756      // TODO: correct behavior?
     757      WSASetLastError(WSAEINVAL);
     758      return SOCKET_ERROR;
     759   }
     760
     761   // post semaphore if present
     762   if (hEvent)
     763   {
     764//      dprintf(("posting event semaphore 0x%x", hEvent));
     765      SetEvent(hEvent);
     766   }
     767
     768   WSASetLastError(NO_ERROR);
     769   return NO_ERROR;
     770}
     771//******************************************************************************
     772//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.