tags:

views:

147

answers:

1

In terms of comet, I often hear about Bayeux. I know that:

Bayeux is a protocol for transporting asynchronous messages (primarily over HTTP), with low latency between a web server.

But is it important? Is it necessary? Are there alternatives? Does everyone use it? Is Bayeux the only protocol? Aren't there sites, like Facebook? that doesn't use Bayeux? Is google wave an equivalent?

Thanks.

+2  A: 

It is primarily used for long-polling communication.

Most web communication is generally one way. The client sends a request to the server and the server returns some data. The server can generally send data to the client when it responds to a request from the client.

With long-polling, the client browser will open a connection to the server. The server may return some data, but will not close the connection. This connection stays open. Then when the server needs to communicate some data to the client, it just sends it down this connection.

It is the only way you can get a web server to instantaneously send information to a web client. Useful in chat programs and the like.

This is possible to do with any (or at least most) web servers; however to keep a client connection open can take up a lot of resources. If you have 20,000 clients doing this on a single IIS server, it will take down the machine. It will not be able to cope with this.

Bayeux is a very efficient way of achieving this. Using Jetty with the CometD library that implements Bayeux, 20,000 simultaneous clients is no sweat!

Mongus Pong