Announcer is a class that allows your server to announce itself to any clients over the local network. This means that your client doesn't need to already know or prompt the user for the server host name and port. Instead, the client transmits a special packet looking to match a server name. If a message comes back, it contains the server and port information the client needs to connect.
To get started, you need to download the announcer library and add it to your project.
There are two classes you need to know about:
In a nutshell, the Server starts a ServerSocket, creates a GameInfo object, given the ServerSocket's local port number, and creates a new Announcer to announce the game. The client simply calls one of the static find methods to get a GameInfo object about the game. It can then use the host and port information embedded within the GameiInfo object to connect to the server.