I want to create an application like this:
What is the most efficient way to create this real time application ?
Flash ? Long polling ? Http Streaming ? or anything else ?
Thanks ;)
I want to create an application like this:
What is the most efficient way to create this real time application ?
Flash ? Long polling ? Http Streaming ? or anything else ?
Thanks ;)
For now, long polling is probably the best solution. Many big-name sites have long polling implementations, including Facebook, Google and eBay. Not everyone has Flash installed/enabled in their browsers. In the future Web Sockets might be able to do an easier job of it for us.
Update: As of this writing, the WebSocket API is implemented in the latest WebKit (Chrome/Safari) and Firefox 4 beta. There is also a public snapshot build of Opera available for download with an implementation of the API. This means testing the API is widely available. For more information, see this answer.
I don't think long-polling is most efficient way to do Comet. Anyway, it sends new HTTP request after response is got. It cost more extra HTTP requests than HTTP streaming.
But, long-polling might be more reliable and easier to implement than HTTP streaming. According to this article in Google Code, HTTP streaming might not be functional if intermediate HTTP proxy buffers content.
It is interesting that GMail doesn't use long-polling. With the help of Http sniffer, it is clear that it uses HTTP streaming for Comet.