Re: Daemon with Net::Daemonby bm (Hermit)
|on Sep 02, 2003 at 10:31 UTC||Need Help??|
Here is an explanation of Net::Daemon.
Define a new class that inherits from Net::Daemon in daemon.pl
In your class's constructor, call the Net::Daemon constructor and then do any other initialisation you need.
Now write your Run method. This method overrides the Run method in Net::Daemon. It is executed whenever a client connects to the daemon
Now go ahead and create your server
So at this point you have a daemon sitting there waiting for a request. Run this script on server A.
Now you need a client to submit a request from server B. In client.pl:
Run client.pl on your client machine, webserver(B), and it will send a request via the TCP protocol to your daemon waiting on server A.
Note that there are some security concerns with this. Don't let your daemon accept just any list of commands to run on server A. Perhaps sends 'RunA' from client.pl, and your daemon will then go ahead and execute a hardcoded set of commands before sending back the response.
Hope this helps