Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unable to make a connection with the external ip address

843790Sep 22 2009 — edited Oct 27 2009
I made a simple chat program in order to test the networking. I was able to make local connections using the internal ip addresses, bu when I try the external ip address, the connextion fails.

Here is my ServerSocket in the MessengerServer class : ServerSocket server = new ServerSocket(1234);
And here is the code that worked in the local network in the MessengerClient class: s = new Socket(InetAddress.getByName("192.168.1.4"), 1234);
I also tried that code, using both the external and internal addresses : s = new Socket(InetAddress.getByName("71.178.183.40"), 1234, InetAddress.getByName("192.168.1.4"), 1234);

Can anyone help me?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2009
Added on Sep 22 2009
26 comments
615 views