Hi, I am new to
java and completely new to this networking. I tried to run this program in order to have a communication between client/server. when I tried it in the same network its working.Then, I have kept both programs in different networks and tried to communicate. This is where its throwing an error
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.networking.DailyAdviceClient.go(DailyAdviceClient.java:15)
at com.networking.DailyAdviceClient.main(DailyAdviceClient.java:35)
I really doubt if its achievable or do I need to add something for this?Oh and by the way I have "Port Forwarded" the routers in both locations.
CLIENT PROGRAM:
SERVERPROGRAM: