Detecting server on lan I would like to have the client detect a server on a lan. So there will
be some 30 clients on the same lan as a single server and when they start
I want them to be able to find the server and automatically connect to it
for using RMI.
My idea was to have them send out a UDP packet to the broadcast address
and then have the server respond saying, "Here I am!", but I'm having
difficulty figuring out how to send a UDP packet to the broadcast address
of the lan.
I tried just sending it to "255.255.255.255", but this didn't work. Is
there a way to detect the broadcast address? Is there a way to send a
packet to it? Is there a simpler way to do what I'm trying to do?
Thanks.
--
Ken T. http://www.electricsenator.net
As we enjoy great advantages from the inventions of others, we should
be glad of an opportunity to serve others by any invention of ours.
-- Benjamin Franklin |