Re: signal handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aras wrote:
> 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.

I don't know what is going wrong bu5t I would like to ...
If it were my problem I'd start by configuring more calls to pcntl_signal()
to cover all signals and add some more info to the output of your signal handler
so you can see whats what (e.g. pid etc) - maybe some signals are being sent but
your not trapping them...

also does removing the pcntl_signal() calls completely have any positive effect.

sorry if I suggesting stuff that is obvious to you - I still kind of new
to all this cmdline scripting, process signalling, etc - although it's something
that has been keeping me busy and I'm looking to increase my understanding.

> 
> My code: http://pastey.net/2910
> 
> 
> Thanks!
> Aras
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux