winsock - recvfrom and WSAECONNRESET

Started by
0 comments, last by Ozymandias42 17 years, 7 months ago
I've been writing a networked client and server in Windows XP, and I've been testing locally. I run the server, then I launch the client, which connects to the server. So far, so good. However, if the client is suddenly disconnected, on the server's next recvfrom() call, I get back SOCKET_ERROR, which turns out to be WSAECONNRESET. Also, every subsequent call to recvfrom() is also WSAECONNRESET. If I start a new client up, sometimes its data gets through, but when there's no data in the pipeline, it's still that same WSAECONNRESET error. Am I supposed to do something with this error to indicate I've received it in order for it to go away, and is it normal to get so many of this error?
Advertisement
Actually, I just got an idea for why this is happening (had to happen while I was at work). When the recvfrom() fails, that doesn't stop me from sending regular update packets to the locally-connected client. Does anyone know if the host and port values are set correctly on this error? I could search through my list of clients looking for one with that address and port and stop sending packets there.

This topic is closed to new replies.

Advertisement