Re: [PHP] Re: Stop PHP execution on client connection closed

2011-09-13 Thread Marco Lanzotti
Il 13/09/2011 15:22, Eric Butera ha scritto:
> Flush all buffers you have. Sometimes you have to do nasty hacks like
> send a certain number of characters.
I'm looking for a way to send some characters during query execution.

>  You might have better luck if you search for 'comet' or 'long polling.' 
Long polling requires script interaction. How can I interact while I'm
waiting for query to be executed?

Bye,
Marco

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



RE: [PHP] Re: Stop PHP execution on client connection closed

2011-09-13 Thread yeer tai


You can use ajax.



> Date: Tue, 13 Sep 2011 09:22:54 -0400
> From: eric.but...@gmail.com
> To: ma...@lanzotti.com
> CC: php-general@lists.php.net
> Subject: Re: [PHP] Re: Stop PHP execution on client connection closed
> 
> On Tue, Sep 13, 2011 at 4:01 AM, Marco Lanzotti  wrote:
> > Il 13/09/2011 09:39, vikash.i...@gmail.com ha scritto:
> >>
> >> You can use ob_start() to start output buffering and ob_end_flush() to send
> >> some data in the middle of script  - that way  your php script will send
> >> some data to the client earlier than finishing execution and hence detect
> >> the aborted connection.
> >
> > The question is: how can I send data to client until I'm waiting for
> > query execution? PHP thread support is not available in Apache enviroment.
> >
> > Bye,
> > Marco
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> Flush all buffers you have.  Sometimes you have to do nasty hacks like
> send a certain number of characters.  Execution will still continue
> along after your buffers are send if it is still blocking for a query.
> 
> You might have better luck if you search for 'comet' or 'long polling.'
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
  

Re: [PHP] Re: Stop PHP execution on client connection closed

2011-09-13 Thread Eric Butera
On Tue, Sep 13, 2011 at 4:01 AM, Marco Lanzotti  wrote:
> Il 13/09/2011 09:39, vikash.i...@gmail.com ha scritto:
>>
>> You can use ob_start() to start output buffering and ob_end_flush() to send
>> some data in the middle of script  - that way  your php script will send
>> some data to the client earlier than finishing execution and hence detect
>> the aborted connection.
>
> The question is: how can I send data to client until I'm waiting for
> query execution? PHP thread support is not available in Apache enviroment.
>
> Bye,
> Marco
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Flush all buffers you have.  Sometimes you have to do nasty hacks like
send a certain number of characters.  Execution will still continue
along after your buffers are send if it is still blocking for a query.

You might have better luck if you search for 'comet' or 'long polling.'

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



Re: [PHP] Re: Stop PHP execution on client connection closed

2011-09-13 Thread Marco Lanzotti
Il 13/09/2011 09:39, vikash.i...@gmail.com ha scritto:
>
> You can use ob_start() to start output buffering and ob_end_flush() to send
> some data in the middle of script  - that way  your php script will send
> some data to the client earlier than finishing execution and hence detect
> the aborted connection.

The question is: how can I send data to client until I'm waiting for
query execution? PHP thread support is not available in Apache enviroment.

Bye,
Marco

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



Re: [PHP] Re: Stop PHP execution on client connection closed

2011-09-13 Thread vikash . iitb
On 13 September 2011 13:05, Marco Lanzotti  wrote:

> Il 12/09/2011 21:32, Al ha scritto:
> > See http://us2.php.net/manual/en/function.connection-aborted.php
>
> As I wrote, PHP doesn't detect that client aborted connection until it
> send some data.
> During query the script doesn't send any data to client, so it doesn't
> detect client aborted connenction.
> I know this function, but it's useless to solve my problem...
>

You can use ob_start() to start output buffering and ob_end_flush() to send
some data in the middle of script  - that way  your php script will send
some data to the client earlier than finishing execution and hence detect
the aborted connection.


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


Re: [PHP] Re: Stop PHP execution on client connection closed

2011-09-13 Thread Marco Lanzotti
Il 12/09/2011 21:32, Al ha scritto:
> See http://us2.php.net/manual/en/function.connection-aborted.php

As I wrote, PHP doesn't detect that client aborted connection until it
send some data.
During query the script doesn't send any data to client, so it doesn't
detect client aborted connenction.
I know this function, but it's useless to solve my problem...

Bye,
Marco

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