During my years at the university, I had a personal project for creating a simple chat program in Java using TCP sockets. The project was intended for educational purposes only.
One thing that I was not very happy with was that the client had to know the IP address of the server in order to connect to it. So I thought it would be nice if clients could find out if there are any chat servers on the network.
How can I implement such a mechanism? If you could point me in the right direction, I would be grateful. :-)
I think the server will have to do some kind of translation, but I'm not sure how to do this.
PS: I know that there may be other / better ways to do this, but at the moment I am particularly interested in how to get the client to detect servers on the network.
And by server, I mean the server side of the chat application, not the Tomcat server.
Stian source share