I\'m writting a java application, and I need to quickly discover any other running clients on any wired or wireless local networks in order to establish a TCP connection.
<
There is a JGroups toolkit for reliable multicast communications. It allows automatic discovery of additional clients using Multicast techniques as described in other answers.
It also provides communication APIs on top of multicast sockets.
It is used in a number of projects such as JBoss, Tomcat and more to provide an infrastructure for distributed cache. See more here.