comet

Using comet with PHP?

有些话、适合烂在心里 提交于 2019-11-25 22:30:50
问题 I was thinking of implementing real time chat using a PHP backend, but I ran across this comment on a site discussing comet: My understanding is that PHP is a terrible language for Comet, because Comet requires you to keep a persistent connection open to each browser client. Using mod_php this means tying up an Apache child full-time for each client which doesn’t scale at all. The people I know doing Comet stuff are mostly using Twisted Python which is designed to handle hundreds or thousands

How do I implement basic “Long Polling”?

做~自己de王妃 提交于 2019-11-25 22:13:56
问题 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!

What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet?

江枫思渺然 提交于 2019-11-25 21:44:54
问题 I have tried reading some articles, but I am not very clear on the concepts yet. Would someone like to take a shot at explaining to me what these technologies are: Long Polling Server-Sent Events Websockets Comet One thing that I came across every time was, the server keeps a connection open and pushes data to the client. How is the connection kept open, and how does the client get the pushed data? (How does the client use the data, maybe some code might help?) Now, which one of them should I