|Syntactic Confectionery Delight
server 'autodiscovery' on a LANby schweini (Friar)
|on Nov 24, 2005 at 02:57 UTC
schweini has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to try to make a script of mine reeeeaaly easy to deploy and configure, by allowing it to automatically figure out where its server is located, connecting to a certain port on that server, identify itself by using the client's IP (or something), get the matching configuration via the connection, and start up.
I've got a problem with the first step. How can i elegantly 'find' a server? The obvious solution would be to ping all machines on the subnet, try to connect to the specified port, and if that is successful, assume that that machine is the server. Is there a more elegant way to do this? Maybe using broadcast packets or something?