今天看windows网络编程中overlapped操作,发现程序例子的操作顺序同说明的不一致
程序顺序:// Step 5:
// Wait for the overlapped I/O call to complete
Index = WSAWaitForMultipleEvents(EventTotal,
EventArray, FALSE, WSA_INFINITE, FALSE);
// Index should be 0 because we
// have only one event handle in EventArray
// Step 6:
// Reset the signaled event
WSAResetEvent(
EventArray[Index - WSA_WAIT_EVENT_0]);
This document is created with the unregistered version of CHM2PDF Pilot
// Step 7:
// Determine the status of the overlapped
// request
WSAGetOverlappedResult(AcceptSocket,
&AcceptOverlapped, &BytesTransferred,
FALSE, &Flags);
说明顺序:5.Call WSAWaitForMultipleEvents using the event array and wait for the event associated with the overlapped call to become signaled.
6.Determine the return status of the overlapped call by using WSA-GetOverlappedResult.
7.Reset the event object by using WSAResetEvent with the event array and process the completed overlapped request.
拿出来大家讨论一下啊