Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: UDP Socket Stuck in NotReady Status  (Read 1979 times)

0 Members and 2 Guests are viewing this topic.

engineerjames

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
UDP Socket Stuck in NotReady Status
« on: September 04, 2016, 08:13:21 pm »
I have a simple Client/Server program that functions as follows:  Each client sends data (name and x/y coordinates) to the server.  The server then sends all player data to each client.  Each client then draws every player onto the screen (simplistic multiplayer game).

The program works flawlessly on my internal network, but if the clients use the 'public' IP the following occurs:  The clients are able to send information to the server but unable to receive from the server (the receive call always shows the socket in a NotReady status). 

This is the gist that shows the function call that ultimately fails (socket.receive): https://gist.github.com/engineerjames/5b48bc138b9966f866d11344a6ad334d

This is the main while loop in the client code that calls the failing function:
https://gist.github.com/engineerjames/021a5bbc46e66f9a0dabfa294b934137

The x and y position are stored as floats, the player name is an std::string.  Any ideas?  Thanks in advance; let me know if I can provide any additional details that would be helpful.

EDIT:  Forgot to include, but I have forwarded all ports utilized in my program (and tested using Port Forward Network Utilities and Simple Port Tester), and tried disabling my firewall on the computer I was testing on.  This problem also persists if I run the server and client on separate computers (works on local network, but doesn't using the public IP).

EDIT2: Further clarification--when I mentioned that the client is able to still send information to the server; that is only true for the FIRST packet.  All other packets seem to not transfer correctly (no errors that I can see, but just zeroes are received for the player's position each time).  Again, this only happens when using the 'public' IP address.

« Last Edit: September 05, 2016, 04:17:25 am by engineerjames »

 

anything