What I am trying to do is discover servers on the same subnet. I
believe that multicast UDP is the standard sort of way for
solving this problem. (At least that's what I've done before,
and IIRC it's what JINI service discovery is based on). It's
really simple (and fast). Your server just broadcasts a small
id-string on a pre-determined multicast group on a periodic
basis (i.e. once every 250ms). Clients join the group and listen
for a second or so to pick up any id-strings being broadcasted.
That's it. Actually with Jini it's more the other way around.
The client sends a multicast request for the next lookup
service, with it's ip address in the source address field. The
lookup services (the servers) are listening for these requests
and will send back a unicast answer. The 255.255.255.255 isn't a
multicast, but a global broadcast. You can send and receive
broadcasts by setting the broadcast property on a
DatagramSocket. Using the global broadcast address usally works
but is regarded as BadStyleTM The real bro