Sockets over the 'net.

Oct 26, 2008 at 12:03pm
hello, im need to know must i do to "talk" to the server as shown below.


Client (192.168.1.200) --> router (123.123.123.123) --> Internet --> router (210.210.210.210) --> Server (192.168.1.100:9000)

i already know the basics of socket programming; how to set up a server, and how to connect a client. but how do i solve this problem?

thanks.
Last edited on Oct 26, 2008 at 12:04pm
Oct 26, 2008 at 4:55pm
Your routers are acting as NATs, which means your client must know the server's public IP address/port number and then the client must connect to that. 192.168.1.100 is the server's private IP address and is unroutable directly.
Oct 26, 2008 at 11:56pm
yeah, ok.... but how do i get the router to recognise that the traffic is bound for that particular server?

sry, i dont get all these NAT stuff... and can only get the "theory" stuff but not practical NAT and programming stuff from google.

to make matters worse, people connect through the ISP's proxy.


could i trouble u to explain and pretty much tell me how to connect to the target, or is there a good webby that u know of?

thanks.
Last edited on Oct 27, 2008 at 2:31am
Oct 27, 2008 at 5:28am
As far as I know, you cannot tell the router which computer behind it you want to connect to. The routers I've seen (not very many) usually have a system called "port forwarding" that sends all traffic on a particular port on the router to the same port on a particular computer.
Oct 27, 2008 at 1:18pm
Unfortunately I don't know how you will get the IP/port you need. The router is assigning 192.168.1.100:9000 a publicly routable IP address and port number. You need to know what it assigned.

You might be better off posting on some other network-specific forum, as your question is more in the realm of network administration than C++.
Topic archived. No new replies allowed.