[Libevent-users] GetQueuedCompletionStatus return values
question/problem
Kevin Sanders
newroswell at gmail.com
Wed Nov 1 12:31:32 EST 2006
On 11/1/06, Gordon Scott <gscott2112 at gmail.com> wrote:
>
> > Something else that might be bitting you here; you should be setting
> > *lpNumberOfBytes = 0 before calling GetQueuedCompletionStatus.
> That
> > way, on exit, if you have *lpNumberOfBytes == 0, you either have a
> > closed remote socket (GetLastError() == 0), or some error
> > (GetLastError() != 0).
> >
> > GetQueuedCompletionStatus doesn't randomize the lpNumberOfBytes in
> > case of error, it just doesn't change it from what you set it to.
>
>
> Also I believe that GetLastError() will return the standard winsock error
> codes for things like a connection reset
Yeah, I don't have my code handy at the moment, but I remember
handling a remote reset in the error handling code.
Toby, the GLE error codes are documented here;
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp
I'm not sure how many ways you want to slice that error. If it is a
low resource type error, you may be able to recover from it. Once the
I/O errors start flying on a socket though, you'll probably want to
CloseHandle on it and move on with trying to reconnect/recover in some
way.
More information about the Libevent-users
mailing list