- Using WaitForMultipleObjects:
- Makes it possible, to wait for one or all of specified objects to change to a singled state
Question:
- How can one wait for a specified amount – such as
5, for example
Usage
dwEvent = WaitForMultipleObjects( maxExpectedConnections, ghEventsA, TRUE,//but wait for a specified number instead INFINITE);
Use the waitall flag to indicate that you want the wait to return when any object is signalled. When wait returns, remove the signalled object from the array of objects and wait again until you have N (e.g. 5 in your case) signalled objects.