Re: signal handling

From: Date: Fri, 08 Dec 2006 16:19:05 +0000
Subject: Re: signal handling
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-245650@lists.php.net to get a copy of this message
# manager@phidot.com / 2006-12-02 02:01:35 +0200: > Hello > > Despite all of my results to succeed, i can not make this work. What i want > to do is 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. I am > trying to use signal handling, but some comments say through hanging > sockets, it is not possible to handle signals. > > How can i stop this from happening, i am attaching the code i am working on, > the 2 signals added at the bottom are just for test there, i tried all other > signal types. Sending a posix_kill(posix_getpid(), SIGKILL) to the process > when the client exits does not kill it too, it still is defunct. > > My code: http://pastey.net/2910 The parent needs to wait(2) for its children. http://php.net/pcntl_wait -- 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

« previous php.general (#245650) next »