[Libevent-users] GetQueuedCompletionStatus return values
question/problem
Toby Douglass
toby.douglass at summerblue.net
Fri Nov 3 03:13:52 EST 2006
Gordon Scott wrote:
>>> Now - here's the rub - what's to prevent *lpNumberOfBytes being 0 in
>>> case 3? the docs say in case 3, the value in *lpNumberOfBytes is not
>>> set by GetQueuedCompletionStatus(). So, it would retain whatever value
>>> I set it to originally. I'm thinking then that I need to set
>>> *lpNumberOfBytes to a value, say 1, and then if it's different, I'll be
>>> able to *know* it was set to 0.
> Not true. As per the documentation in condition 3 sets the number of bytes
> read. If there is an error and 0 bytes have been read, it will be set
> to 0.
Hmm. Re-reading the docs, I'm starting to think that that final
sentence in return values about socket closure is red herring.
It *reads* like it's telling you a fourth unique return value case; but
actually, maybe all it's doing is pointing out to you what you'll see
when a socket closes - and failing to mention, as it were, that it's
only a specific case of the general instance of case 3.
More information about the Libevent-users
mailing list