c++ - GetQueuedCompletionStatusEx() doesn't return a per-OVERLAPPED error code -
i'm using getqueuedcompletionstatusex()
api, , i've realized can indeed read n overlappeds packets in 1 syscall, instead of 1 overlapped, getqueuedcompletionstatus()
, concern cannot know per-overlapped error code.
while getqueuedcompletionstatus()
returns 1 overlapped per call, gives me ability check, calling getlasterror()
, last error current overlapped packet.
how getqueuedcompletionstatusex()
in fact returns n overlappeds packets, not n error codes?
i have read around calling getoverlappedresult()
can achieve that, point is: if call getqueuedcompletionstatusex()
n overlappeds packets, , have call syscall each of them, benefit of calling 1 syscall n overlappeds pointless, since you'll call 1+n syscalls. @ point stay getqueuedcompletionstatus()
, call n syscalls (for n overlappeds) instead of 1+n.
do know more this?
the completion status stored in overlapped.internal
field. noted, that's native api status code, not winapi error code. easy way translate call getoverlappedresult(). doesn't matter pass bwait argument, return immediately. use wsagetoverlappedresult() sockets.
Comments
Post a Comment