函数原型如下
BOOL WSAAPI WSAGetOverlappedResult(
_In_ SOCKET s,
_In_ LPWSAOVERLAPPED lpOverlapped,
_Out_ LPDWORD lpcbTransfer,
_In_ BOOL fWait,
_Out_ LPDWORD lpdwFlags
);
在MSDN上看到这样的两处描述:
fWait [in]
If TRUE, the function does not return until the operation has been completed. If FALSE and the operation is still pending, the function returns FALSE and the WSAGetLastError function returns WSA_IO_INCOMPLETE.
第二处在Remarks部分,
A pending operation is indicated when the function that started the operation returns FALSE and the WSAGetLastError function returns WSA_IO_PENDING
这里我想请教各位的是,对未完成的异步I/O请求进行这个API调用时,并且对对参数 fWait 传入 FALSE,获取的错误码究竟是 WSA_IO_INCOMPLETE ,还是 WSA_IO_PENDING ?
另外,还有个问题,CancelIOEx(),这个API能否真的用于套接字上的所有异步I/O的请求?我自己测试了下,貌似可以,但是调用过此API后,相应套接字上的所有重叠I/O的WSAOVERLAPPED结构的Internal成员的值会被填充为3221225760,这个值代表什么呢?
请各位高手不吝赐教