Home of Ebyan Alvarez-Buylla

Web Development

Comet Long Polling with PHP and jQuery

Comet Long Polling with PHP and jQuery

Comet describes a number of techniques with which a web server may push information to a client in a non-transactional format. Long Polling is one of such techniques, in which a browser’s request remains open until the server has information to send.

Long Polling is particularly useful in semi-synchronous applications, such as chat rooms and turn-based games, and is straightforward to implement with PHP and jQuery: