Re: [PHP] script not terminating on user abort

2003-08-25 Thread Dennis Jacobfeuerborn
On Mon, 2003-08-25 at 01:15, Curt Zirzow wrote:
> * Thus wrote Dennis Jacobfeuerborn ([EMAIL PROTECTED]):
> > Hi!
> > The connection_* function don't seem to work for me and I can no longer
> > determine when the user has aborted the script. When I close the browser
> > window the script just keeps running. (see bug #23163)
> > 
> > The body of the script essentially looks like this:
> > 
> > while( !$done ) {
> > $con->sendMessage("x"); # Send msg to Jabber server
> > sleep(1);
> > }
> > 
> > I made an interesting and somewhat weird observation though:
> > If I use the print or echo command in the while-loop once (!) then the
> > script will terminate after the loop has run *exactly* three times after
> > the abort.
> > 
> > If I put more than one print/echo in the loop (2->inf) then the script
> > will terminate after *exactly* 2 (!) iterations of the loop after the
> > script has aborted.
>  
> how is it your knowing the number of times it is going through the
> loop when the conneciton is aborted?

By counting the number of "x" messages I receive on the other end of the
Jabber connection.

>  If you know that the
> connection is aborted why isn't it breaking out of the loop? Do you
> have some code that can show this?
> 

this code will just continue to send "x" messages after an abort:

while( !$done ) {
$con->sendMessage("x"); # Send msg to Jabber server
sleep(1);
}

this code will send exactly 3 "x" messages after an abort:

while( !$done ) {
$con->sendMessage("x"); # Send msg to Jabber server
sleep(1);
print "foobar";
}

this code will send exactly 2 "x" messages after an abort:

while( !$done ) {
$con->sendMessage("x"); # Send msg to Jabber server
sleep(1);
print "foobar";
print "foobar"; # any additional number of print/echo commands will
do
}

I hope this helps.

regards,
  Dennis

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



[PHP] script not terminating on user abort

2003-08-24 Thread Dennis Jacobfeuerborn
Hi!
The connection_* function don't seem to work for me and I can no longer
determine when the user has aborted the script. When I close the browser
window the script just keeps running. (see bug #23163)

The body of the script essentially looks like this:

while( !$done ) {
$con->sendMessage("x"); # Send msg to Jabber server
sleep(1);
}

I made an interesting and somewhat weird observation though:
If I use the print or echo command in the while-loop once (!) then the
script will terminate after the loop has run *exactly* three times after
the abort.

If I put more than one print/echo in the loop (2->inf) then the script
will terminate after *exactly* 2 (!) iterations of the loop after the
script has aborted.

The length of the string used in the print/echo statement doesn't seem
to matter.

I hope this helps as this bug is currently a showstopper for the stuff
I'm developing (a PHP Jabber client).

I'm running Red Hat 7.3 with the standard apache-1.3.27-2 package and a
self-compiled php-4.3.3rc4 (php-4.3.2 didn't work either).
-- 
-----
conversis GmbH

Dennis Jacobfeuerborn
Geschäftsführer

Falkstraße 73-77
47058 Duisburg

[EMAIL PROTECTED]

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