in reply to How do I run an Infinite loop with a CGI?

From the brute force and stupidity department: split the two and use an interface to control starting and stopping the daemon.
(1) make the socket listener a completely separate program (sounds like it already is) that starts and stops listening on the socket depending on some outside control (like listening on a second socket, or watching for files in its home directory, or catching a signal, or something.)
(2) make the CGI send the start and/or stop signals to the daemon. This also solves some security problems. rob_au's suggestion is also entirely valid, this is just TIMTOWTDI, and possibly more portable to strange environments like Win32.
--
Spring: Forces, Coiled Again!
  • Comment on Re: How do I run an Infinite loop with a CGI?