Jump to content
  • Advertisement
Sign in to follow this  
md_lasalle

Weird VPS behavior with recvfrom()

This topic is 3164 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, we rented some Windows VPS around the world for our latest multiplayer game. The issue I'm seeing is that when a client closes its socket, instead of the server recvfrom() returning an error with the client's external ip/port, it returns with the client's internal local ip/port (ie. 192.168.0.x). What can be causing this behavior ? Is there a better way to match recvfrom() errors to the corresponding client on the server ? Why does it only happen when we test on a VPS ? Thanks. [EDIT] Also to note : we only see the behavior with people behind a home router. We can't reproduce the issue when people are connecting using the company's network, which seems to be weird seeing how complex the structure can be. [Edited by - md_lasalle on October 23, 2009 11:03:32 AM]

Share this post


Link to post
Share on other sites
Advertisement
The "error" from recvfrom() is not guaranteed; it's just a report that the underlying system got an ICMP error for a previous send message. The best way to detect closed clients is to have clients send a bye message, and if that message doesn't make it, detect time-out.

It may very well be that the NAT router that sends the ICMP error message doesn't properly translate the client-internal network address when forwarding it back to the server, because the initial "port not open" message comes from the client inside the client-side NAT.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!