完成商品的几个疑问
1.投递重叠操作产生错误,并且产生的错误非WSA_IO_PENDING(也就是投递失败),完成端口是否会收到关于此次重叠操作的结果?
2.关于GetQueuedCompletionStatus的返回值处理的问题:
MSDN中指出了有3种情况,其中一种是:
If *lpOverlapped is NULL and the function does not dequeue a completion packet from the completion port, the return value is zero. The function does not store information in the variables pointed to by the lpNumberOfBytes and lpCompletionKey parameters. To get extended error information, call GetLastError. If the function did not dequeue a completion packet because the wait timed out, GetLastError returns WAIT_TIMEOUT.
如果 *lpOverlapped为NULL, 且函数没能从完成端口取出一个完成包,返回值则为0。函数则不会在lpNumberOfBytes and lpCompletionKey所指向的参数中存储信息。调用GetLastError, 可以得到一个扩展错误信息。如果因为等待超时而未能出列一个完成包,GetLastError返回WAIT_TIMEOUT.
请教何时会产生这种情况?应该如何处理这种情况?