Questions tagged [comet]

Comet is a generic term used to describe technology used to "push" data from a web server to connected web clients. In contrast to a "typical" web connection, in which the client must request data before the server can respond with that data, with Comet implementations, data can be pushed from the server without the client requesting said data. Comet can be implemented in a variety of ways: long-polling, callback-polling, forever-frame, etc.

Comet is a generic term used to describe technology used to "push" data from a web server to connected web clients. In contrast to a "typical" web connection, in which the client must request data before the server can respond with that data, with Comet implementations, data can be pushed from the server without the client requesting said data.

Comet can be implemented in a variety of ways:

Each has a variety of pros and cons, such as compatibility, cross-domain capabilities, and feature support (such as detecting disconnections, etc.).

Each Comet server is typically comprised of two major components:

  1. The server component. This component is responsible for handling the connections to the clients, and where much development effort is spent; small optimizations in this code make huge changes overall (for example, if one client stores 1 KB additional data, and you have 30,000 clients connected, that is an extra 30 MB of data that the server needs to store and track.
  2. The client component. This component is responsible for receiving data from the server component. The most common client is written in JavaScript, for use with a web browser, but clients can often be written in other languages as well, to facilitate integration with thick client applications. For example, Jetty has a client written in Java, and WebSync has clients written for Silverlight and standard .NET.

Common Language Implementations

There are a large amount of frameworks that could power a Comet based application. Most of these are standalone servers, with the exception of WebSync which runs on top of IIS.

  1. Java: Jetty, Rupy
  2. .NET: WebSync
  3. Python: Twisted
  4. Ruby: Event Machine
  5. JavaScript: Node.js
  6. Scala: Lift
  7. C++: CppCMS

More information

Some good resources for Comet include:

  1. http://ajaxpatterns.org/HTTP_Streaming
  2. http://cometdaily.org/
1111 questions
-1
votes
1 answer

Django: Best Way to Push Buttons Without Page Reloads?

I’m using the djangoratingsapp to create a system of “likes” and “dislike” buttons, and everything seems to work well. However, I am using a very basic button type of layout in the template and using the standard POST protocol to register button…
EazyC
  • 809
  • 1
  • 10
  • 30
-1
votes
1 answer

Node.js vs PHP long-polling performance

I've read and heard that nods.js should be better and lighter at the server when doing long-polling then on a PHP-server. I'm doing a study on this and would like to measure the serverload at two simple long-polling applications to see the…
Inzajt
  • 135
  • 2
  • 13
-1
votes
1 answer

turn based game with ajax and php

I develop a turn based game and want to put up to browser to test with real users. because it is a turn based game I don't need it to be real time. my idea is using old school chatroom method to set text to communicate between 2 players. after much…
sooon
  • 4,718
  • 8
  • 63
  • 116
-1
votes
1 answer

comet with php socket server?

i've read that php doesn´t scale well if a lot of users are using your comet implementation? is that because of the apache server or the php language? what is a socket server and does it fix that problem? someone that has set up a php comet server…
ajsie
  • 77,632
  • 106
  • 276
  • 381
-1
votes
1 answer

using comet iframe with jquery?

I haven't found any good tutorial with code examples on how to use comet with jquery. found this link: http://www.zeitoun.net/articles/comet_and_php/start but they are using prototype. and I found a comet plugin for jquery on the jquery website but…
ajsie
  • 77,632
  • 106
  • 276
  • 381
-1
votes
3 answers

Which open-source comet/ reverse-ajax libraries will you recommend to be used with Tomcat 5.5? Why?

I have seen continuations in Jetty 6.0 that addresses scaling for comet/reverse-ajax applications. Are there any other libraries/frameworks to be used with Tomcat 5.5?
Tahir Akhtar
  • 11,385
  • 7
  • 42
  • 69
-1
votes
2 answers

I need to know how COMET works

i want to implement comet in php... i have idea about how ajax works but i tried to study about long polling server push using comet but i am facing problem to figure out how it works. so can you please help me...
pradeepa
  • 4,104
  • 5
  • 31
  • 41
-1
votes
1 answer

refreshing many divs with jquery load method

I have a sql database holding some data, and I have a page with bunch of divs (like 30+) displaying this data. Every single div is holding different database value. What i want to achieve is to auto-refresh all that divs with jquery item.load()…
Chris
  • 517
  • 1
  • 9
  • 22
-1
votes
2 answers

Update the web page (jsp , servlet)

I'm writing a chess game by servlets and jsp pages. here is my problem: when the player 1 move his/her nut I wanna update the player 2's jsp page that player 2 could see the the move of player one. tnx
-1
votes
1 answer

Installing APE project on Mac OS X

I would like to test Ajax Push on my local server and I found Ape-progect but I need help to install and configure it. Honestly I don't know how to start... Can someone help me to install and configure APE project on Mac OS (snow leopard)? Which…
Uncoke
  • 1,832
  • 4
  • 26
  • 58
-2
votes
1 answer

java.util.Vector Roadblock

Referring to: http://download.oracle.com/javase/7/docs/api/java/util/Vector.html#addElement(E) I have an assignment for my OOP class where I have to write classes for a Asteroids-like java game. I have to use vectors to represent the x and y…
Hank
  • 475
  • 9
  • 28
-2
votes
4 answers

What would be the quickest, most efficient way to reload content on a blog page once change has been detected?

I want to create a blog, which I want to be very user-friendly, and I want the most efficient way to display recent blog posts. For example, one might want to programmatically reload a div every 5 seconds or so, or they might send a request every 10…
Lucas
  • 16,930
  • 31
  • 110
  • 182
-2
votes
1 answer

Long polling causing huge delay

I am using long polling to check if there is any new incoming data.I am facing a problem when one request is waiting for a response the other requests are not being processed until this one completes.I am using jQuery Ajax post method and async =…
Tyranicangel
  • 189
  • 2
  • 16
-3
votes
1 answer

You can't go to other page if you didn't get response

$(function() { function x() { $.ajax({ cache: false, type: "post", data: 'messages=' + 5, url: 'http://url.com', complete: function(data) { x(true); …
good_evening
  • 21,085
  • 65
  • 193
  • 298
-3
votes
1 answer

What are alternate usage of websockets (except comet)?

I know websockets provide a better solution for comet (reverse Ajax, often done with long-polling). Can we use them for something else? Example: - Can we use them to communicate between browsers? - Can we use them to communicate with a Java…
JB Hurteaux
  • 4,428
  • 6
  • 32
  • 35
1 2 3
74
75