The MSDN page for WriteFileEx
says that it can not be used in IOCP model because it has an argument to specify the completion routine. If the file handle has been associated with an I/O completion port, then WriteFileEx
will fail.
However, WSASend
allows the caller to specify a completion routine as its last argument, while this function can be used in IOCP model.
I examined several examples of WinSock with IOCP, and found the last argument lpCompletionRoutine
is always null. Is this mandatory?