Page 1 of 1

Need this ajax long polling example explained

Posted: Thu Jan 20, 2011 8:45 pm
by slick1537
Hey all!

I was reading this example http://blog.perplexedlabs.com/2009/05/0 ... g-polling/ that explains what ajax long polling is and a simple means to implement it. Based on that reading though I have a question. If the script on the server side does not find any new data to send back to the client, it terminates after 30 seconds. If the client does not receive a callback how does it know to close and re-open the connection? Thanks!

- slick1537

Re: Need this ajax long polling example explained

Posted: Fri Jan 21, 2011 1:57 am
by Christopher
I think the idea with long-polling is that the server does not close the connection but keeps sending data as it is available on the same connection. The client waits for data on the same connection. The problem is that the webserver needs to be configured to support a large number of simultaneous connections.