0

Please help me .I am new in Socket programming.These are process i am following .So please help me in 5th point because i am stuck in that point to implement

  1. I have created socket programming with a client and server system.

  2. Client and server are communicating perfectly in local network.

  3. When I am making a laptop with dongle as a server and connecting with a client machine which resides within a router(local system within a local network created by router) is working fine.

  4. when I am making server a machine which resides within a router (local system within a local network created by router)and trying to communicate with client which is a laptop with dongle(ie outside local network) is not working. Every time it is giving timed out error message.

  5. Outside local network system is not able to communicate with inside local network(ie system within router).

Thanks In advance

  • 1
    This needs much more info. What IP addresses are you using to connect from outside the local network? Have you set up port forwarding in your router and are you using the public-facing IP of your local network, as opposed to a local address? – Pekka Jun 16 '15 at 06:07
  • First I am connecting my local system (That is within the router)with the server(that is outside network) successfully connection establish.Now the server which is outside the local network get a IP and port number of the client(that is inside the router) and this IP is nothing but the public IP. Now the system outside the local network client to connect local system with that IP address and port number and getting connection timeout exception . Yes,I am using public IP of the local network for the communication. – user2663217 Jun 16 '15 at 06:44
  • Have you set up port forwarding in your router for that specific port? – Pekka Jun 16 '15 at 06:49
  • No, I am making an application(in java) which will communicate with any system in the world with the help of socket with chord protocol.So I need to connect the system throughout world. So is it possible to make port forwarding in every router with the help of application? – user2663217 Jun 16 '15 at 06:50
  • This is a hard problem, see e.g. http://stackoverflow.com/questions/9656198/java-udp-hole-punching-example-connecting-through-firewall – Pekka Jun 16 '15 at 06:52
  • THis looks like a good introduction to the issue http://www.brynosaurus.com/pub/net/p2pnat/ – Pekka Jun 16 '15 at 06:53

0 Answers0