[PHP] Re: PHP daemons

2006-05-16 Thread M. Sokolewicz
Well, by looking into my cristal ball I think your problem lies at line 
12 of file x.php for sure!! It's probably the 
I_have_not_seen_any_code_at_all(so I can't tell you anything about it) 
function there.


goodluck!
- tul

Martin Marques wrote:
I've been using PHP for a while with a daemon I made a few years ago, 
which is in use, working great. I used the example that's in the docs:


http://www.php.net/manual/en/ref.sockets.php

A few months ago I started to make a new daemon for other purposes, and 
I decided to build some objects to make it OOP. This small server is 
almost fully functional, but I got into a small problem: I can't kill 
the daemon like I used to with the other daemon. I just won't die, 
unless I get the pid and send a SIGKILL to the pid.


Both servers are runned executing the PHP script, which has in the first 
line:


#!/usr/bin/php

In the first daemon all I have to do to kill it is execute a
pkill server_name.

But with the new daemon (the object orientaded one) it doesn't die. Any 
ideas on why?


--
 21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
-
Lic. Martín Marqués |   SELECT 'mmarques' || Centro de 
Telemática|   '@' || 'unl.edu.ar';

Universidad Nacional|   DBA, Programador,
del Litoral |   Administrador
---
--


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



[PHP] Re: PHP daemons

2006-05-16 Thread Martin Marques

On Tue, 16 May 2006, M. Sokolewicz wrote:

Well, by looking into my cristal ball I think your problem lies at line 12 of 
file x.php for sure!! It's probably the I_have_not_seen_any_code_at_all(so I 
can't tell you anything about it) function there.


No problem. :-)

I solved it making a second script that I run when I want to close the 
server. This script just conects and sends a shutdown string. I changed 
the daemon so that it will recieve this string and close all conections, 
close the socket and break all the loops. :-)


Any way, I don't know why the code from the first daemon finish well when 
a kill is sent to it (remember that this daemon is a copy from the first 
example at: http://ar2.php.net/manual/en/ref.sockets.php)


--
 21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
-
Lic. Martín Marqués |   SELECT 'mmarques' || 
Centro de Telemática|   '@' || 'unl.edu.ar';

Universidad Nacional|   DBA, Programador,
del Litoral |   Administrador
-
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP daemons

2006-05-16 Thread Jad madi
Martin, 
I'm afraid we cannot help you without reading the code, paste it to
phpfi.com and send the url here

now the general answer is, OOP or not OOP it doesn't matter
there is problem in the code whatever and however it's written dude. 

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



Re: [PHP] Re: PHP daemons

2006-05-16 Thread Martin Marques

On Tue, 16 May 2006, Jad madi wrote:


Martin,
I'm afraid we cannot help you without reading the code, paste it to
phpfi.com and send the url here

now the general answer is, OOP or not OOP it doesn't matter
there is problem in the code whatever and however it's written dude.


Yes (the code is really big, that's why I didn't paste it).

My question would be then, how can I control a SIGTERM signal from inside 
a PHP CLI script?


P.D.: My original problem was solved, as you can see in an earlier post.

--
 21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
-
Lic. Martín Marqués |   SELECT 'mmarques' || 
Centro de Telemática|   '@' || 'unl.edu.ar';

Universidad Nacional|   DBA, Programador,
del Litoral |   Administrador
-
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php