RE: spawning a process that uses pipes - doesn'tterminatewhen webpage download is canceled

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

 



On Mon, 2009-06-01 at 07:52 -0700, bruce wrote:
> hi robert...
> 
> i got the popen/php process but i don't see how one can stop a
> browser/apache process, and somehow reattach to the browser process.. unless
> he's talking about stopping a process within the app's context.. and then
> contniuing..

Hi Bruce,

He's spawning child processes to handle the audio changes. These
processes are separate processes from the PHP script being run by the
webserver. However, they are children of the PHP script process since
they have been started by the PHP script via popen() or proc_open(). His
problem is that when the user changes page mid load, or shuts down the
browser, the PHP script (the parent) is killed off by the webserver, but
the child processes, sox and lame, continue to run. This ends up
polluting CPU/memory with useless processes. What he wants is to have
these processes also die. So by using proc_open() he can retrieve the
output from the processes he has started and send that to the connected
browser in chunks, but also detect if the browser has dropped its
connection in which case he can manually kill of the child processes
that aren't being killed automatically. HTH.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
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