Simple "Long Polling" example code?

Posted by dbr on Stack Overflow See other posts from Stack Overflow or by dbr
Published on 2008-12-02T11:14:47Z Indexed on 2010/06/12 4:22 UTC
Read the original article Hit count: 542

Filed under:
|

I can find lots of information on how Long Polling works (For example, this, and this), but no simple examples of how to implement this in code.

All I can find is cometd, which relies on the Dojo JS framework, and a fairly complex server system..

Basically, how would I use Apache to serve the requests, and how would I write a simple script (say, in PHP) which would "long-poll" the server for new messages?

The example doesn't have to be scaleable, secure or complete, it just needs to work!

© Stack Overflow or respective owner

Related posts about http

Related posts about comet