1

I have a client and server application in two computers. i am trying to connect them through internet TCP connection. the problem im facing is.

Client (192.168.1.2) -> [router] (124.43.224.112) --

-> (internet) -> [router] (124.43.190.63) -> Server (192.168.1.3)

How do i establish a TCP connection ?

Mafahir Fairoze
  • 697
  • 2
  • 9
  • 21
  • You should not write anything special for that, you have to ask the IT guy to configure the network correctly so both computers can talk each other, using a VPN or configuring the ports or whatever your network infrastructure needs. – jmservera Nov 06 '10 at 15:54

2 Answers2

2

Internet 101:

The router 124.43.190.63 must be configured to do port forwarding to 192.168.1.3. Client connects to 124.43.190.63.

You must understand these basics if you're writing a networking application.

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
0

In order for the client to connect to a server that is hidden behind a router you need to setup port forwarding on the server's router. That way when the client attempts to connect to a configured port on the server's router, the request is forwarded onto the server.

brain
  • 5,496
  • 1
  • 26
  • 29