Ò»¡¢Ãû³Æ½âÊÍ£º
Comet×îÔçÊÇÓÉAlex Russell£¨Dojo Toolkit ÏîÄ¿Ö÷¹ÜºÍDojo FoundationÖ÷ϯ£©ÔÚ×Ô¼ºµÄ²©¿ÍÖÐÌá³öµÄÊõÓËûÊÇÕâÑù˵µÄ£º¡±New services like Jot Live and Meebo are built with a style of data transmission that is neither traditional nor Ajax. Their brand of low-latency data transfer to the browser is unique, and it is becoming ever-more common. Lacking a better term, I¡¯ve taken to calling this style of event-driven, server-push data streaming ¡°Comet¡±.¡± ¡°They all use long-lived HTTP connections to reduce the latency with which messages are passed to the server. In essence, they do not poll the server occasionally. Instead the server has an open line of communication with which it can push data to the client.¡±
CometÖ¸µÄÊÇÒ»ÖÖWebÓ¦ÓóÌÐò¼Ü¹¹¡£¿ÉÒÔÖ±½Ó˵£¬Ëü²»ÊÇÒ»ÖÖ¼¼Êõ£¬¶øÊÇÒ»ÖÖ˼Ï룬ֻÊÇÕâÖÖ˼Ïë²ÉÓÃÁËÒÑÓеļ¼ÊõȥʵÏÖ¡£ÔÚÕâÖÖ˼ÏëÀ¿Í»§¶Ë£¨Client£©²»ÐèÒªÏÔʽµØÏò·þÎñÆ÷¶Ë£¨Server£©·¢³öÇëÇó£¬Server»áÔÚÆäÊý¾Ý·¢Éú±ä»¯µÄʱºòÖ÷¶¯½«Êý¾ÝÒì²½·¢Ë͸øClient£¬´Ó¶øʹClientÄܹ»¼°Ê±¸üÐÂÊý¾Ý²¢³ÊÏÖ¸øÓû§¡£Ëü²»Í¬ÓÚ´«Í³µÄWeb£¬Ò²²»Í¬ÓÚµ±Ç°Á÷ÐеÄAjax£¬ÕâÖÖ˼Ïë·Ç³£¼Ü¹¹Ë¼Ïë·Ç³£ÊʺÏevent-driven(ʼþÇý¶¯)ʽµÄWebÓ¦ÓúͶԽ»»¥ÐÔ¼°ÊµÊ±ÐÔÒªÇóºÜÇ¿µÄÓ¦Ó㬱ÈÈç¹ÉƱ½»Ò×£¬ÁÄÌìÊÒ£¬Web IM£¬ÍøÓεȡ£
¶þ¡¢³É¹¦°¸Àý£º
GMail¡¯s GTalk integration
Jot Live
Renkoo
Meebo
Èý¡¢ÊµÏÖ·½Ê½£º
CometʹÓÃClientºÍServer֮ǰµÄHTTP³¤Á´½Ó×îΪÊý¾Ý´«ÊäµÄͨµÀ¡£
ʵÏÖComet£¬×î³£¼ûµÄÓÐÏÂÃæÁ½ÖÖ·½Ê½£º
AjaxµÄ³¤ÂÖѯ£¨long-polling£©£ºJavascriptÔÚ´¦ÀíÍê·þÎñÆ÷·µ»ØµÄÐÅÏ¢ºóÔٴη¢³öÇëÇó£¬ÖØн¨Á¢Á¬½Ó¡£²»Í¬ÓÚÒ»°ãµÄAjax£¬JavascriptÇëÇóServer£¬ÎÞÊý¾ÝʱServer²»ÖжÏÇëÇó£¬still loading£¬ÔÚÒ»¶¨Ê±¼äÄÚ£¬»ñÈ¡µ½Êý¾Ýºó£¬·µ»ØÇëÇó£¬ÓÖJavascript»ñÈ¡Êý¾ÝºóÔٴη¢³öÇëÇó£¬ÓÉ´ËÂÖѯ¡£ÐèҪעÒâµÄÊÇÇëÇóµÄ¼ä¸ôʱ¼äÒÔ¼°Ã¿´ÎÇëÇóµÄ×Loadingʱ¼ä¡£
Óŵ㣺Òì²½ÇëÇó£»ÎÞÐèä¯ÀÀÆ÷Èκβå¼þÖ§³Ö£»²ÉÓÃAjax¼¼Êõ£¬¼æÈÝÐÔÇ¿£»
ȱµã£º»á²úÉú´óÁ¿µÄͨÐÅÁ¿£¬Ö»ÄÜͨ¹ýÔö¼ÓÂÖѯµÄʱ¼ä¼ä¸ôÀ´¼õÇáServerµÄѹÁ¦£»
Iframe½áºÏHtmlfileÁ÷£¨streaming£©£ºÍ¨¹ýÔÚÒ³ÃæÉÏǶÈëÒ»¸öÒþ²ØµÄIframe£¬ÉèÖÃÆäsrcÊôÐÔΪһ¸ö³¤Á¬½ÓµÄÇëÇó£¬Server²ÉÓÃflush·½Ê½½«Êý¾Ý×÷Ϊǰ¶ËJavascriptº¯ÊýµÄ²ÎÊý´«µÝ£»
Óŵ㣺²»»áÓкܴóµÄͨÐÅÁ¿£¬¶øÇÒÊý¾Ý½ÓÊշdz£¼°Ê±£¬²¢ÇÒÎÞÖжϣ»
ȱµã£º»á²úÉú½ø¶ÈÌõµÄLoading״̬²¢Ò»Ö±´©×Å£¬Óû§Ê¹ÓÃÌåÑéºÜ²»ºÃ£¬ÔÚGoogle TalkÖУ¬Í¨¹ýHtmlfile Active½â¾öÁËIEϵĽø¶ÈÌõÏÔʾÎÊÌ⣻±£³Ö³¤ÆÚÁ´½ÓÒ²·Ç³£ºÄ·þÎñÆ÷×ÊÔ´£»
ËÄ¡¢ÁÙʱ²ÉÓ÷½°¸£º
Ä¿Ç°£¬°×Éç»á(bai.sohu.com)²ÉÓÃÁ˵ÚÒ»ÖÖ·½Ê½À´ÊµÏÖʵʱÏûÏ¢µÄÍÆËÍ£¬ÕâÖÖ·½Ê½»¹´æÔÚÒ»¸öÎÊÌâ¾ÍÊÇ£¬ÔÚ¶à¸ötabҳϣ¬ÈçºÎ±£Ö¤Ã»ÓÐÏàͬÓòµÄ³¤Á¬½ÓÇëÇó£¨IEÔÚͬÓòÏÂÖ»ÄÜͬʱ֧³ÖÁ½¸ö³¤Á´½Ó£©£¬ÓÚÊDzÉÓÃÁË×ÓÓòÐÎʽÀ´Çø·Ö¶à¸öÓò£¬ÒÔ±£Ö¤Ã¿¸ötabҳϷÃÎʵĵØÖ·¶¼²»ÔÚÒ»¸öÓòÃûÏ£¬´ËʱÎÊÌâÓÖ³öÀ´ÁË£¬³öÏÖÁËAjax¿çÓòÃûÇëÇ󣬲»¹ýÕâ¸öÎÊÌâ±È½Ï³£¼û£¬½â¾ö·½°¸Ò²ºÜ¶à£¬ÎÒÃDzÉÓõÄÊÇIframeÐÎʽ£»ÓÉ´Ë£¬ÎªÁËʵÏÖComet£¬ÎÒÃÇ×ßÁ˺ܳ¤Ò»Ìõ·£¬ËäȻ·µÄÈ·×ßÍêÁË£¬µ«ÊÇ×ߵúܳ¤ºÜ¼èÄÑ£¬ÕâÒ²ÊÇΪʲô³ÆËüΪ¡°ÁÙʱ½â¾ö·½°¸¡±£¬ÒòΪËü²¢²»ÊÇÒ»¸öÍêÃÀµÄ·½°¸£¬µ«ÎÒÒ²ÏàÐÅ£¬ÒÔºó»á¸ü¼ÓÍêÃÀ¡£
Îå¡¢ÏÖÓпɲο¼¿ò¼Ü
Cometd£º¹Ù·½µØÖ·£ºwww.cometd.org
¿ÉÒԲο¼http://www.blogjava.net/xmatthew/archive/2008/11/20/208911.html
Pushlet£º¹Ù·½µØÖ·£ºwww.pushlets.com
pushlet ÌṩÁË»ùÓÚ AJAX µÄ JavaScript ¿âÎļþÓÃÓÚʵÏÖ³¤ÂÖѯ·½Ê½µÄ¡±·þÎñÆ÷ÍÆ¡±£»»¹ÌṩÁË»ùÓÚ iframe µÄ JavaScript ¿âÎļþÓÃÓÚʵÏÖÁ÷·½Ê½µÄ¡±·þÎñÆ÷ÍÆ¡±¡£
¿ÉÒԲο¼http://www.javaeye.com/topic/89158
Áù¡¢ÎÄÕ²ο¼
Comet£º»ùÓÚ HTTP ³¤Á¬½ÓµÄ¡±·þÎñÆ÷ÍÆ¡±¼¼Êõ
ʵս Comet Ó¦ÓóÌÐò¿ª·¢
Comet on wikipedia
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ