This is for those of you who've done some IO completion port work.

According to my reading of the docs, GetQueuedCompletionStatus has four return status';

---

1. return value != 0
   - all went well, we've just returned from a successful dequeuing

2. return value != 0 and lpOverlapped == NULL
- all handles associated with the IO completion object have been closed and the IO completion object itself has been closed (time to quit)

3. return value == 0 and lpOverlapped != NULL
- GetQueuedCompletionStatus() was okay, but we dequeued a *failed* IO operation (note that lpNumberOfBytes is not set in this case)

4. return value == ERROR_SUCCESS and lpOverlapped != NULL and *lpNumberOfBytes == 0 - the handle we've come back on is actually a socket, and the remote host has closed

---

Now, the problem is this: ERROR_SUCCESS is #defined as zero!

In other words, I don't think it's possible to differentiate between case 3 and 4, because in case 3, *lpNumberOfBytes might be 0 just by chance.

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to