[erlang-questions] web sockets almost working ....

Tony Arcieri tony@REDACTED
Thu Dec 10 22:13:15 CET 2009

On Thu, Dec 10, 2009 at 8:55 AM, Max Lapshin <max.lapshin@REDACTED> wrote:

> Look, from server point of view, there is no difference between comet
> and web socket.
> Differs only the common time of being connected.

Comet uses "long polling".  The client connects, sends a request, and the
server doesn't respond until an event is occurred.  The client socket can
time out, in which case it reconnects.  When the client gets a response, it
consumes it and closes the socket.  Once the event is processed, the client
makes a new long polling connection to the server.

Websockets let you use RHTTP.  The client connects, sends a request to
switch to RHTTP, then becomes an HTTP server.  This is a true push model, as
opposed to Comet long polling.  The remote can push an unlimited number of
events back to the client via RHTTP, as the client is now acting as a
server.  The connection between the client and server is never dropped
unless something goes wrong, as opposed to Comet where the connection is
dropped once per event at a minimum.

Tony Arcieri
Medioh! A Kudelski Brand

More information about the erlang-questions mailing list