# jochem@xxxxxxxxxxxxx / 2006-12-08 15:36:52 +0100: > Roman Neuhauser wrote: > > # manager@xxxxxxxxxx / 2006-12-02 02:01:35 +0200: > >> [...] to write a simple socket server in PHP. My current example just > >> prints the same character, you send to server from keyboard. It is > >> successfull in forking, and generates child as people connect. However in > >> any way the client exits, the child process remains defunct on system. > > The parent needs to wait(2) for its children. http://php.net/pcntl_wait > > have I understood correctly that using pcntl_wait() means you can't do anything in > the parent process until all children are dead? no. > but if it is true how do you go about tackling the signal handling in child processes > AND at the same time have the parent process do something useful like ... > interact/direct child processes, do other management tasks whilst child processes are running? do whatever you want, either have a SIGCLD handler, or check one of the wait(2)-family functions every now and then (and make sure to use WNOHANG). -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php