RE: [PHP] Re: Stop PHP execution on client connection closed
| From: | yeer tai | Date: | Tue, 13 Sep 2011 13:30:04 +0000 |
| Subject: | RE: [PHP] Re: Stop PHP execution on client connection closed | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314789@lists.php.net to get a copy of this message | ||
You can use ajax.
> Date: Tue, 13 Sep 2011 09:22:54 -0400
> From: eric.butera@gmail.com
> To: marco@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 <marco@lanzotti.com> wrote:
> > Il 13/09/2011 09:39, vikash.iitb@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
>