[Phpwm] Gmail Talk

Iain Wallace iain at strawp.net
Wed Feb 22 10:39:41 GMT 2006


What was with the 8 hour delay between my post and reaching the list? I
thought we'd sorted that!

>> Can anyone explain, or does anyone have links to articles explaining
>> how that works? It's just a bit too cool.
>
> Ajax is <snip>

I know what AJAX is, sparkes - that wasn't my question. As I said in the
AJAX thread from the day before I've used it on a couple of apps before
now. The "new" thing is, GMail Talk actually *receives* data on time - it
doesn't request data on events like key presses or time outs.

We were talking about this at the LUG last night and from what I can tell
from the sniffed packets is the way Gmail Talk does this is by
initialising the chat session by posting to a web service which just
doesn't terminate. (I gather this is refered to as a "pipeline"). This is
equivalent to a page that doesn't ever finish loading. Every time the user
on the other end of the conversation does something, their data is sent to
the server and this is packed up and pushed into the pipeline, in effect
creating a TCP-like packet which ends up being read by your client's
Javascript. In Ethereal this appears as something like "HTTP Continuation"
instead of just plain "HTTP" which most web data arrives as.

It's an interesting technique, but it must be a nightmare of threads on
Google's chat server, not that this is something someone like Google
probably has to worry about a great deal.

So the next question: How do you write a web service that remains open
like that and doesn't get terminated? Could you do that in Apache?

Cheers,
Iain



More information about the Phpwm mailing list