服务器推送:彗星VS猿? [英] Server push: comet vs ape?

查看:221
本文介绍了服务器推送:彗星VS猿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读过一些关于彗星,也是APE。

I've read a little about comet and also APE.

哪一个更好?我希望用户看到其他用户更新的内容。像谷歌Wave。

Which one is better? I want the users to see other users updated content. Like Google Wave.

和彗星中,有2个版本:iframe的VS传统的Ajax。有什么差异,这是更好的。我不很明白。

And in comet, there are 2 versions: iframe vs traditional ajax. what is the difference and which is better. I dont quite understand it.

感谢。

推荐答案

彗星是一组技术,用于开发实时应用。你有两个主要实现:流和长轮询。

Comet is a set of techniques useful for developing realtime applications. You have two main implementations: streaming and long polling.

在常规的http请求的用户将请求发送到服务器,接收该数据(HTML代码,scrips等),并关闭连接 - 故事的结束。 在流连接被从未由客户端或服务器关闭,有由双方共享的单个连接。

In regular http requests the user sends the request to the server, receives the data (html, scrips, etc) and closes the connection - end of story. In streaming the connection is never closed by the client or the server, there's a single connection shared by both parties.

在长轮询,您有等待响应的经常性联系。基本上,浏览器发送请求到服务器并坐在那里等待,直到服务器响应(服务器只响应的时候,他有新的数据在客户端),然后关闭连接,它是由浏览器重新打开连接,并循环重复:)两中,这是最常用的。

In long polling, you have a recurring connection that waits for a response. Basically, the browser sends a request to the server and sits there waiting until the server responds (the server only responds when he has new data for the client), then the connection is closed and it's up to the browser to reopen a connection, and the cycle repeats :) Of the two, this is the most used.

彗星在浏览器通常需要为大量的长寿命的HTTP连接而优化的网络服务器,和一JavaScript客户端与彗星服务器进行通信。因此,APE是一个可安装的服务器和彗星是其所依据的范例。 在这里,你有彗星实现的列表: http://cometdaily.com/maturity.html

Comet in the browser typically requires a web server optimized for large numbers of long-lived HTTP connections, and a JavaScript client to communicate with the Comet server. So Ape is an installable server and Comet is the paradigm on which it is based. Here you have a list of comet implementations: http://cometdaily.com/maturity.html

这篇关于服务器推送:彗星VS猿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆