With the help of HttpWatch, I tried to figure out how GMail implements Comet.
I login in to GMail with two accounts, one in IE and the other in Firefox. Chatting in
Per this article,
So what is the solution used by Google Gmail?
The solution is really simple, straight forward and very portable! What Gmail did is requesting an endless html page that contains streams of Javascript portions. Give it a try, It’s very powerful. So, we will have on the client side a js file that processes the responses, and another endless html that contains the Javascript Streams.
The rest of the article goes into much more detail, including an exploration of alternatives as well as the specific one picked by GMail.