For some reason whenever bind (or any other Winsock function) returns an error, errno is still set to 0. Any ideas as to what might be causing this?
For some reason whenever bind (or any other Winsock function) returns an error, errno is still set to 0. Any ideas as to what might be causing this?
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Use WSAGetLastError() to get the last error for winsocks.
No idea. I usually get my error codes, but sometimes they disappear. Usually it's because I've screwed up somewhere else though A more specific explanation from someone would be nice though.
**EDIT** Well, yes use WSAGetLastError if you're using Winsock, but those sometimes disappear on me too.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
Well for winsocks WSAGetLastError() only work on commands like accept, bind, listen, etc. If using WSAAsyncSelect the error message is stored in the HIWORD of lparam.
Not true... recv() at least should generate errors retreivable by WSAGetLastError(). When a remote socket drops, recv() will return SOCKET_ERROR and set the error to WSAECONNRESET. I'm pretty sure the other functions have similar function; I highly doubt MS would make a function like WSAGetLastError() only for the least-used socket functions (i.e. connecting/binding/etc.).Well for winsocks WSAGetLastError() only work on commands like accept, bind, listen, etc. If using WSAAsyncSelect the error message is stored in the HIWORD of lparam.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
Sorry, brain isn't working today.
[whine]
Went for road test for a drivers license and got a real jerk who was exceedingly rude and failed me on the basis of being too hesitant (i.e. not aggressive enough) and then wouldn't let my sister talk to the manager on the phone when she called to lodge a complaint, and mouthed off at her too. I think he was an abused child or something.
[/whine]
Since those 3 you put pretty much included everything except for recv() and send() and you said "only works for" I figured you meant to exclude those two My bad.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.