我应该选择哪种方式进行Comet聊天?

时间:2021-07-12 16:16:13

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....

我要实施Comet聊天。很容易为服务器端做出选择,但对于客户端 - 我真的很困惑:长轮询,回调轮询,隐藏iframe,http流,持久性http连接....

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~

我不太了解这些概念,谁可以帮助我更清楚?我只想选择实现Comet聊天客户端的最佳方式〜

3 个解决方案

#1


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.

例如,如果您使用WebSync(对于ASP.NET / IIS),您将使用Bayeux协议的实现作为客户端 - 内置的一个或其他可用的实现之一(dojo,jquery等)满足您的需求。

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

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

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.

您提到的各种项目 - 长轮询,回调轮询等 - 将在各种实现中隐藏起来。在WebSync中,我们支持长轮询和回调轮询,但是在使用客户端时你不需要知道任何事情,因为它会根据所使用的浏览器来处理。

#2


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.

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

#3


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.

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

#1


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.

例如,如果您使用WebSync(对于ASP.NET / IIS),您将使用Bayeux协议的实现作为客户端 - 内置的一个或其他可用的实现之一(dojo,jquery等)满足您的需求。

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

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

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.

您提到的各种项目 - 长轮询,回调轮询等 - 将在各种实现中隐藏起来。在WebSync中,我们支持长轮询和回调轮询,但是在使用客户端时你不需要知道任何事情,因为它会根据所使用的浏览器来处理。

#2


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.

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

#3


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.

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