Comet聊天应该选择什么方式的客户端?

发布于 2024-07-23 12:03:05 字数 154 浏览 4 评论 0原文

我将实现一个 Comet 聊天。 对服务器端做出选择很容易,但对客户端来说——我真的很困惑:长轮询、回调轮询、隐藏 iframe、http 流、持久 http 连接......

我不太了解概念,谁能帮我说得更清楚? 我只是想选择最好的方式来实现一个Comet聊天客户端~

I am going to implement a Comet chat. It is easy to make a choice for the server side but for the client side--I am really confused: long polling, callback polling, hidden iframe, http streaming, persistent http connection....

I don't know much about the conceptions, and who can help me to make it more clear? I just want to choose the best way to implement a Comet chat client~

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

厌味 2024-07-30 12:03:05

一旦选择了服务器端组件,您就会知道要使用哪个客户端组件。

例如,如果您使用 WebSync(适用于 ASP.NET/IIS),您将使用以下实现Bayeux 协议作为客户端 - 根据您的需要,可以是内置协议,也可以是其他可用实现之一(dojo、jquery 等)。

如果您使用 StreamHub 之类的东西,他们也会有一个可用于其软件包的客户端。

您提到的各种项目 - 长轮询、回调轮询等 - 将在各种实现中隐藏起来。 在 WebSync 中,我们支持长轮询和回调轮询,但在使用客户端时您不需要了解任何相关信息,因为它会根据所使用的浏览器来处理这些问题。

Once you have selected a server side component, you'll know what client-side component to use.

For example, if you use WebSync (for ASP.NET/IIS) you'll use an implementation of the Bayeux protocol as a client - either the built in one, or one of the other available implementations (dojo, jquery, etc) according to what your needs are.

If you use something like StreamHub, they'll have a client available for their package as well.

The various items you mentioned - long polling, callback polling, etc - are going to be hidden away from you in the various implementations. In WebSync, we've got support for long-polling and callback-polling, but you don't need to know anything about that when using the client, as it'll take care of that according to the browser being used.

莫相离 2024-07-30 12:03:05

我认为长轮询是大多数商业服务似乎使用的技术。 这是唯一适用于所有浏览器的选项。

I think long polling is the technique that most of the commercial services seem to use. It's the only option that works in every browser.

东京女 2024-07-30 12:03:05

我认为该技术并不重要,只要它适用于所有浏览器即可。 StreamHub Comet 服务器现在有一个免费的社区版本 - 它可以跨浏览器工作,因此您不必担心实施不同的技术,例如长轮询。 当有人已经为您完成所有工作时,为什么还要做所有工作...我建议阅读教程:使用 StreamHub 构建 Comet 聊天应用程序

I don't think the technique matters as long as it works in all browsers. StreamHub Comet server now have a free community edition - it works cross-browser, so you don't have to worry about implementing different techniques such as long-polling. Why do all the work when someone's already done it for you... I recommend reading the tutorial: Building a Comet chat application with StreamHub.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文