Keep It Simple, Stupid | |
PerlMonks |
Re: Backgrounding (daemonizing?) a Net::serverby UnderMine (Friar) |
on Mar 28, 2004 at 09:26 UTC ( [id://340366]=note: print w/replies, xml ) | Need Help?? |
My suggestion for making the client pause until the server has started up would be to use file locking. If you are running on the same server which you appear to be all you need to do is have the server create a locking file on imediately on startup and unlock it when it is ready. Another alternative if you are listening on a socket is to create the socket at the beginning of startup but not begin processing it until you are ready. Daemon != Server because you can daemonise many things not just servers. The most usual place to find non server daemons is repeatative processes such as scheduling or long running processes like batch jobs. I often have batch processing that will run for upto 3 hours if these are not detached an error in the terminal could cause the process to error. Just a few ideas.
In Section
Seekers of Perl Wisdom
|
|