Click to See Complete Forum and Search --> : Remoting between PCs over the internet
124256
July 11th, 2007, 02:42 AM
I'm doing a little remoting project where home PCs act as the clients and the hosts. It all works when I'm working within my LAN, but as soon as I tried to do remoting using my internet IP address rather than my LAN IP, I get a message saying that the server actively closes the connection. When I tried to do this the first time, Windows Firewall popped up asking me to unblock the program, which I did. The second time, Norton Anti-Virus stopped the connection and said there was a Trojan virus coming in from the client's port, but I made an exception for the port I was using and it stopped giving me messages. Now I just get the "actively closed" exception when the client attempts to assign an event handler to a server's event. Note: I am behind a router. However, the connection seems to be getting through the router since Norton pops up. Where is this thing dying?
MikeAThon
July 11th, 2007, 10:15 PM
Did you map ports in your router? Computers behind a router have private-LAN IP addresses (like 192.168.1.101) which are not routable across the Internet. Your router has a fully-routable public IP address, but when a connection request comes into the router, the router needs a port mapping, or it will have no idea of where (on the LAN) to send it.
Mike
124256
July 11th, 2007, 11:04 PM
Thanks! Can someone tell me how to route from the router to the individual computers (at 192.168. etc) , programatically if possible? I don't know if I can ask more of my users than to click the "unblock" button on the various warnings they may receive, so if getting this "route" requires manually getting into my router settings, I'm going to have to find a new way to do this. The idea is that anyone can create a "game room" and become the hosting party, and clients then can find a list online of who is currently hosting and by clicking on tge "game room" name, it gets the necessary connection information for the client.
MikeAThon
July 11th, 2007, 11:51 PM
If the router has UPnP enabled, it can be done programmatically. For one example see "Using UPnP for Programmatic Port Forwardings and NAT Traversal" at http://www.codeproject.com/internet/PortForward.asp
Otherwise, port mappings must be done manually. See www.portforward.com for step-by-step instructions for many common routers.
Mike
124256
July 12th, 2007, 01:49 AM
I tried the UPnP port forwarding utility and it said it couldn't connect with the full internet test. It told me my firewall might be blocking the port (which I check on, and this was not the case). It won't load any connections or IP addresses into the main table. Just curious, but for most wireless LAN networks, is UPnP enabled by default? It's ok if mine got disabled, but the program I'm writing is intended for general distribution.
MikeAThon
July 15th, 2007, 02:51 PM
As you are discovering, when developing an app that will be deployed over the Internet, local network architecture and connectivity issues are paramount, and almost as complicated as the application itself. Just think about your end-users: you are the one writing the program, and even with all your knowledge about the issues, you yourself are having difficulties.
As general advice, before trying to solve the problems programmatically, try to understand them better first. See if you can solve your connectivity issues with manual steps and settings on the two machines. Put aside UPnP and other automatic methods. Once you can make your program work with manual settings/steps, then try to generalize your manual solutions and abstract them into programmatic ones. I think you are trying to jump to the answers before you fully understand the questions.
Mike
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.