Sign in to follow this  
jef396

C# Server to C++ Client, Winsock Error 10054

Recommended Posts

I'm working on a project where we are creating a multiplayer game. The C# server communicates with numerous C++ clients. The problem we are running into is that the C# server sends a packet without any problems to the C++ client, but when the C++ client calls recvfrom (We are using UDP) it returns -1. After it returns -1 WSAGetLastError() reveals error code 10054 which means that the host reset the connection unexpectedly. Only, it didn't. Why is this happening? Before we run into this error numerous packets are sent and recieved by the server and client, but for some reason just 1 more breaks it. The C# app sends the packet with an identical endpoint as for the packets it successfully sends before that, the only thing that changes is the data. We have tried setting the data to 0, putting the data into the previous packet (which worked, but isn't preferable because later nomatter what we send it screws up). What is going on? Please help, we have run into a brick wall. "But I can't be a ponce, I don't know what it is!" - Jeff J.

Share this post


Link to post
Share on other sites
Sounds like a bug on either your server code or your client code. Without seeing anything, I would say check scoping on the server (make sure that the client socket always has a reference to it) and check that the SOCKADDR structure pointer is valid, along with the length set to the size of the SOCKADDR structure when you call recvfrom.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this