TCP/IP connection not possible throught internet to other computer
-
I'v tried to connect two computers using sockets... it works between computers in the same LAN, and between computers in the same internet subnet. But, when i try to connect to computers that are far away in the internet(at another city), the connection fails; it simply doesn't reach the listening computer. I've heared about public and private IPs is this the problem?? How may I fix it up?? Thanks in advance!!
-
I'v tried to connect two computers using sockets... it works between computers in the same LAN, and between computers in the same internet subnet. But, when i try to connect to computers that are far away in the internet(at another city), the connection fails; it simply doesn't reach the listening computer. I've heared about public and private IPs is this the problem?? How may I fix it up?? Thanks in advance!!
if the remote computer is connected to a router you will have to setup port forwarding on the router. E.G. something that wont work: ---------------------------- Remote computer(client) | Router(without port forwarding) | Remote computer(server) ----------------------------- something that will work: ----------------------------- Remote computer(client) | Router(with port forwarding) | Remote computer(server) -----------------------------
-
if the remote computer is connected to a router you will have to setup port forwarding on the router. E.G. something that wont work: ---------------------------- Remote computer(client) | Router(without port forwarding) | Remote computer(server) ----------------------------- something that will work: ----------------------------- Remote computer(client) | Router(with port forwarding) | Remote computer(server) -----------------------------
well, the connection works through the router cause i can connect to other computers in the internet that are in the same city... connection doesnt work connecting to computers in another city... may it be a problem between nodes?? my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection so i cannot use this ip because i dont connect to any concrete computer. i dont know what to do...
-
well, the connection works through the router cause i can connect to other computers in the internet that are in the same city... connection doesnt work connecting to computers in another city... may it be a problem between nodes?? my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection so i cannot use this ip because i dont connect to any concrete computer. i dont know what to do...
arr2arr1arr wrote:
my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection
You mean all the computers on your LAN have the same public IP? That's normal. The problem is on the remote end. You need the public IP of the remote to connect to, and if the remote is on a LAN behind a gateway/router then the remote network needs to be configured to forward connection requests to the appropriate computer on the LAN. This is usually accomplished by port forwarding. Remember an address consists of an IP address and a port number. The port number is used to identify the application associated with the socket.
"If you can dodge a wrench, you can dodge a ball."
-
arr2arr1arr wrote:
my public ip (i get it from www.whatismyip.com[^] ) is the same as all other computers i use in my connection
You mean all the computers on your LAN have the same public IP? That's normal. The problem is on the remote end. You need the public IP of the remote to connect to, and if the remote is on a LAN behind a gateway/router then the remote network needs to be configured to forward connection requests to the appropriate computer on the LAN. This is usually accomplished by port forwarding. Remember an address consists of an IP address and a port number. The port number is used to identify the application associated with the socket.
"If you can dodge a wrench, you can dodge a ball."
Ok, my computer is the "remote computer" that is listening for HTTP incoming connections. i have my public ip; i try to connect from other computer that is not behind the same gateway. how to allow forward connection requests to my computer on an internet gateway? (Could the problem be not in my router but in the internet gateway it connects to??)
-
Ok, my computer is the "remote computer" that is listening for HTTP incoming connections. i have my public ip; i try to connect from other computer that is not behind the same gateway. how to allow forward connection requests to my computer on an internet gateway? (Could the problem be not in my router but in the internet gateway it connects to??)
-
arr2arr1arr wrote:
how to allow forward connection requests to my computer on an internet gateway?
Thanks to all!! Now i know how it is done!! Just get into router options in "http://(RouterIpAddress)/"
:)
"If you can dodge a wrench, you can dodge a ball."