Original Post
Hi all I'm a newbie with I/O Completion Port. I'm learning "Network Programming For MS Windows",I don't understand a piece of code with the I/O Completion Port part in the book,as below. Why does it zero PerIoData->Overlapped' memory?
// Post another WSASend or WSARecv operation.
Flags = 0;
// Set up the per-I/O operation data for the next
// overlapped call
ZeroMemory(&(PerIoData->Overlapped),
sizeof(OVERLAPPED));
PerIoData->DataBuf.len = DATA_BUFSIZE;
PerIoData->DataBuf.buf = PerIoData->Buffer;
PerIoData->OperationType = RECV_POSTED;
WSARecv(PerHandleData->Socket,
&(PerIoData->DataBuf), 1, &RecvBytes,
&Flags, &(PerIoData->Overlapped), NULL);