Jump to content

Archived

This topic is now archived and is closed to further replies.

pentan

How do you keep an AJAX connection live?

Recommended Posts

I'm using AJAX to feed data to a PHP program and that program has to do a fair bit of processing if the data stream is large.  The connection seems to be timing out if I send large chuncks.  How can I force the connection to remain open until the PHP program finishes executing the process?  The process can take as long as two minutes.

Thanks,
Michael

Share this post


Link to post
Share on other sites
I suspect this is more of a php time out issue....

something taking that long is NOT good for clients to stay on your site.

you could always fork your scripts

[url=http://www.phpfreaks.com/tutorials/71/0.php]http://www.phpfreaks.com/tutorials/71/0.php[/url]

Share this post


Link to post
Share on other sites
I'd agree that this is a PHP timeout.  You could try setting the timeout in the php.ini file if you have access to it or you could set it through code using set_ini().

Alternatively, you could split the work up and send it to the server in chunks.

Share this post


Link to post
Share on other sites
Yes, you probably need to adjust php's time out limit.

But, if your asking: how do I halt the browser untill the process is complete, use a [u]synchronous[/u] request. Not recommended BTW.

But what in heavens sake are you doing that takes up to two minutes? That's madness.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.