A simple networking question
Members - Reputation: 188
Posted 15 October 2012 - 09:40 AM
When my client computer attempts to connect to a server, I'm assuming it has picked a port to tell the server it can use to communicate back. Is this a standard port or a random one?
Moderators - Reputation: 28168
Posted 15 October 2012 - 10:47 AM
Generally apps that connect to the server don't care about the outbound port and let the system use any random unused port.
Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.
Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.
GDNet+ - Reputation: 2025
Posted 16 October 2012 - 11:47 AM
That would make sense. I'm assuming the router associates this random port with the internal IP address of the computer that sent the request.
Yes, that's standard router procedures.
(LAN IP / internet IP)
192.168.1.2:61455 <-> 18.104.22.168:12233.
You'll need port forwarding to host a game on a specific router port.
Edited by papalazaru, 16 October 2012 - 11:47 AM.
Everything is better with Metal.
Moderators - Reputation: 9506
Posted 16 October 2012 - 01:58 PM