![]() |
"open http" ajax?
i know that things like meebo.com and googletalk work on open http connections via ajax so that there isnt a "refresh" or new query going on every x seconds... how is this done? i cannot find information on it from a development standpoint. any direction would be helpful
|
it's called comet, and last time i checked, was a bit complicated.
there is no single, standardized way to do this. it's the wild west. Comet requires both front and back end code, and different techniques work better in different browsers. i recommend a script tag trigger and an AJAX data pipe. you can send stuff to and request stuff from the server whenever you want, so all you really need to do is know when to do so, which requires a 2nd connection. when something happens on that 2nd connection, you re-use the first connection to actually fetch the data, and optionally upload more. the 2nd connection should be used only to trigger. if you try to push data through your 2nd connection, you will find a lot of cross-browser headaches. |
is it possible to just have AJAX query my red5 server? or would that have to go through flash?
|
Quote:
i would still use a dummy event connection, a regular ajax callback can dispatch the data update fetch. if you leave the 2nd connection open, the call back won't fire until the connection is closed by the server. |
well i have Fiddler installed and watched activity for meebo.com and there are no 2 connections. theres just 1 open connection that doesnt ever get to status 200....
|
Quote:
with the "dual connection" method i refer to, you actually only have one connection open at any given time. the 2 connection refer to the roles of xmlHtttpRequest objects or dynamic script tags. the delayed-close connection stays open waiting for new data. when that data arrives, that long-open connection closes, signaling the availability of new data. that new data is downloaded via the other connection. if meebo has figured a way to reliably trickle data through the signal pipe, i wouldn't be surprised. the last time i tried the "single pipe" approach, i hit severe xbrowser problems. it could be better now. i think there might even be turn-key commercial comet packages available. |
im trying this one out and it isnt working yet
http://sourceforge.net/projects/comet/ |
ok i am using comet successfully for chatting but it keeps the "loading" circles/cursors going even after the page is loaded... i tried it with iframes too and that didnt change anything... how do i fix this?
http://www.zeitoun.net/articles/comet_and_php/start this is the method i am using except in php i changed it to use Memcache instead of text files... |
| All times are GMT +1. The time now is 02:50 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.