I develop a chat (server and client) using Sockets. It's working on LAN but when I try to connect the client to the server using my public IP address it says it cannot connect to that address. My address is public - a friend pinged my address successfully. You find everywhere examples and code for chat applications - but only over local network.
What's the problem? How can my chat work over the Internet? (I can post code if necesarry).
Please help me. I need this so much!

Recommended Answers

i need help with this too...

Jump to Post

First: picking up an almost 2 year old thread :sigh:
Second: look up RMI (Remote Method Invocation) http://download.oracle.com/javase/tutorial/rmi/index.html

Jump to Post

All 7 Replies

i need help with this too...

Question asked 2 years ago....

However , if your chat application(using sockets) works over intranet(LAN) successfully then it WILL and should work over internet also..
Check the source code whether the server and client IP's and port numbers are correct..

That is not an issue, at least if you entered the real IP, not your intranet IP, e.g. starting with 192.168. If you entered the correct info your firewall might be troubling you, which is why i suggested using RMI, since it has built in http tunneling.

Ok. Thanks for that. Ill use RMI for my program! Thanks. Yeah my router does not have proper portforwarding facilities. I configured NAT to forward all ports. Then the ports were open for an hour or so and suddenly everything went dark....

But the app works well with local loop. Thanks for the help!!!!

You can forward your Port used in Chat Softwar from your router... then you will be able to use that software over the internet :)

It will only work using your local machine.
RMI is a lot more 'waterproof' and user-friendly, since the client won't have to do anything.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.