-
[RESOLVED] TCP/IP Ports?
I have made a few TCP/IP based programs in the past. One of the requirements my program had was to open up the required port in the user's router.
How does MSN / AIM / Google Talk etc.. communicate with a server without making me open the required port in my router? Does it not need a new port to be opened? If so, how do I do the same?
-
Re: TCP/IP Ports?
Those services also require an open port.
-
Re: TCP/IP Ports?
What ports do they use? Are the ports already open, or does the program open the port? Since I never confirmed any change to my router...
-
Re: TCP/IP Ports?
Outbound connections (initiated by the client) don't require an open port because outgoing traffic is usually not caught by the router. Listening for incoming connections from behind a router requires that traffic on a port or port range is forwarded from the router to the target machine (the server). Don't bump your threads.
-
Re: TCP/IP Ports?
In your case you probably have a program acting as a server, behind your NAT router.
Those IM services you list have already taken care of exposing their servers to the outside world. So you'd need to do the same, typically by configuring your router to map incoming connections on port X to computer Y port Z on your private (inside) network. X and Z can be the same port, but usually they don't have to be. Outside users will always connect to X though, since this is the exposed port.
If you are using a recent OS (XP or later) there are system components that allow your program to create and delete such mappings. It depends on whether your router has UPnP, has it turned on, and the level of UPnP support it offers.
See [VB6] PortMapper - UPnP NAT Traversal Class which I posted a while back. You could drop the Class into your projects and use it as is, or read it as an example of how to use the upnp.dll directly yourself.
-
Re: TCP/IP Ports?
Thank you - this thread is resolved :check: