| Author |
Regarding GMAIL CHATS
|
Pankaj Tiwari
Ranch Hand
Joined: Sep 11, 2005
Posts: 55
|
|
Hi All Actually i had a doubt about the working of the chats in gmail. I wanted to know what goes behind the scene in the chats. I have some novice level knowledge of AJAX. I wanted to know that when some one pings you then what is the sequence of events in background. Is it that there is some Ajax request that the browser keeps on making to the server (after some timeout period) and there is some kind of service running that responds to the request or is there something like server push kind of thing. I hope you all understand my question. The basic reason for asking this question is that i came across a term called as server push and wanted to know what exactly it is... Thanks in advance Pankaj Tiwari
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Download Firefox and install Firebug (http://www.getFirebug.com) Firebug will show you all of the requests that are made via the XMLHttpRequest Object. Eric
|
 |
Pankaj Tiwari
Ranch Hand
Joined: Sep 11, 2005
Posts: 55
|
|
|
I tried using that but could not figure out much. It actually shows counts(80 request) etc. but one thing that i am not able to figure out is that when someone replies to my chat then how the changes are reflected...i guess something in there about connection keep-alive?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
It is polling the server for new info. Other ways of doing it is to use COMET which is basiclaly just holding a connection open. Eric
|
 |
Pankaj Tiwari
Ranch Hand
Joined: Sep 11, 2005
Posts: 55
|
|
Hi Eric First of all sorry for replying late. Actually i am working on a trading application in which whenever a trade is done the data is broad casted to all the users who are logged in the system, essentially it is simulating server push. Now i know two ways of doing that, one is using Applet that will open a socket on client machine and listens to that socket for the data from server and as soon as data is available it will update the client DOM. Other technique is using AJAX call. It is something like this, I make a AJAX call to server and the server holds request and send response only when there is data available to broadcast. and after that same DOM manipulation technique. Now, i am totally confuse as to what technique will be better because functionally either of these technique will be fine. what do you people say on this. Another point is if AJAX is used then there might be issues with the javascript, mainly because i have heard that javascript does not behave how you expect it to. Still personally i feel AJAX would be better option. Thanks and Regards Pankaj Tiwari
|
 |
Andreanes Yosef Vanderlee
Greenhorn
Joined: Mar 30, 2007
Posts: 12
|
|
I think most of all web based chat application will use polling technology or maybe push (comet). If you're interesting with this thing, you can try to look some web based chat open source like http://sf.net/projects/open-v-chat (similar to meebo, but doesn't connected to IM server) or try any mirc web based *there's a lot of this in sf* Regards, Andre
|
 |
 |
|
|
subject: Regarding GMAIL CHATS
|
|
|