Jump to content
  • Advertisement
Sign in to follow this  
luke2

SDLNet port mismatch diagnosis.

This topic is 4236 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, I've been making my suite of SDL libs recently ( I've finished a nice graphics lib so far ) and right now I'm working on my network lib. Using the tutorial on the game programming wiki; I've basically copied (by hand) the source into methods of a NetLib class and a main method. My client connects to the server (although when the server reads the message from the client, its garbage) and prints out it's local IP. The client prints out Xip and Yport. The server, when it gets the clients connection attempt prints the clients ip (remote) as Xip and Mport. I don't understand why the ports are read differently in the two programs; could this be causing my server to receive garbage? btw, this is all on one machine. 127.0.0.1:2000

Share this post


Link to post
Share on other sites
Advertisement
If it's a TCP/IP connection, and it connected, then it has the right port. If your output appears wrong, it's because you're displaying the wrong information, and if your data is garbled, then you're reading something wrongly. Bear in mind that a connected socket has a local port and a remote port, but only the client's remote port and the server's local port will match.

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!