6

I have read up about what COMET streaming is, and all the various hacks required to get it working across the major browsers. The problems encountered seem to be two fold: 1. Server being able to support many persistent connections 2. Implementing the JS functionality

I have an application where I need to perform COMET streaming. I have already tackled the first problem above - I have a custom server running which delivers updates as it arrives in chunks. I want to now be able to connect using JS to this URL, so I can receive the updates.

Is there a simple COMET library I can use for this? I saw the Orbited project. Can I use the client side JS of orbited to perform this? What kind of modifications do I need to perform in the backend for this?

4

1 回答 1

3

如果您可以让您的服务器代码符合 Bayeux 规范,那么您可以使用任何现有的cometd javascript 实现,目前在 DOJO 和 jQuery 中可用。不幸的是,规范相当复杂,特别是如果你想同时进行长轮询和回调轮询。你最好只运行一个现有的 Cometd 服务器,比如 Jetty,然后为你的服务器代码编写一个客户端库来将数据推送到它。

于 2009-07-05T09:50:53.060 回答