?
Comet 技术、框架与应用
Comet 有 long polling, streaming 两种方式
Streaming 技术:
隐藏的 Iframe
XMLHttpRequest Streaming
HTML 5 server-sent 事件
HTML 5 Web Socket API
Dojo Bayeux 协议
XMPP BOSH 协议
JSONRequest 对象
插件: Java applets 或 Flash
?
Long polling 技术:
XMLHttpRequest polling
Script tag long polling
?
开源框架:
??????????? Dojo CometD ―― http://cometdproject.dojotoolkit.org/
??????????? DWR ―― http://directwebremoting.org/dwr/index.html
??????????? ICEfaces ―― http://www.icefaces.org/main/home/
??????????? GlassFish Grizzly ―― https://grizzly.dev.java.net/
CometD 目前实现 Comet 比较成熟, DWR 弱一些。 ICEfaces 更商业化,实现得很成熟。 Grizzly 是基于 GlassFish ,也很成熟。 CometD, DWR 开源性好。
?
服务器:
??????????? Jetty 6, 7 ―― http://jetty.codehaus.org/jetty/
? ?????????? Tomcat 6, 7 ―― http://tomcat.apache.org/
??????????? GlassFish 3 ――
http://www.oracle.com/technetwork/java/javaee/community/index.html
Jetty 对 Comet 支持的很好,与 CometD 、 DWR 都能集成, Tomct 有 NIO 支持 Comet ,还没有实现, GlassFish 更像一个产品。
?
当然 Comet 也有一些产品, lightstreamer, sitepen, liberator, Orbited
?
应用:
??????????? Meebo (long polling)
??????????? Gmail + GTalk (iframe streaming, htmlfile ActiveX)
??????????? JotLive
??????????? KnowNow
??????????? 4homemedia.com (GlassFish )
?
?
?