views:

196

answers:

1

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?

+2  A: 

If you can get your server code to conform to the Bayeux specification then you can use any of the existing cometd javascript implementations, current available in DOJO and jQuery. Unfortunately, the spec is quite complex, especially if you want to do both long-polling and callback-polling. You may be better of just running an existing cometd server like Jetty and then writing a client library for your server code to push data to it.

bertrandom
There is a BayreuxClient implementation in the java client sample code in the Cometd distribution which handle all the details providing a simple interface including call back for incoming messages.
Thorbjørn Ravn Andersen