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.
<
I guess you need to do a scan on your application's port on all IPs in your subnet.
Just what are the available IPs - or what is your subnet for that matter?
I'm afraid determining that could turn out to be impossible as the network is designed to be transparent to your application.
So, i'd use brute force: pick your IP and change the last byte. Might be too much, might be not enough though.
Or you send a broadcast (which usually would be targeted at x.x.x.255) and see who answers. See Datagram Broadcasting and Multicasts. But i think that's not TCP/IP anymore.