GWT Comet

This gwt-comet library provides an efficient Comet implementation for GWT.

Overview

The library implements Comet by streaming messages over long lived HTTP requests to minimise latency and bandwidth requirements and maximise the throughput. This is opposed to many other implementations which use polling or long polling techniques.

Features

Browsers

The latest Safari and Chrome implementations use Server-Sent Events

The Firefox and older Safari and Chrome implementations use a XMLHTTPRequest and listen for onreadystatechange events to process the incoming messages.

The Opera implementation uses Opera’s built in proprietary Server-Sent Events.

The Internet Explorer implementation is based on the ActiveXObject HTML file transport. Put simply an ActiveXObject HTML file containing an <iframe> referencing the appropriate server url is created. The server sends <script> tags to the the <iframe> which are then executed. The Java Script in the <script> tags contain a call to a GWT method with a string parameter containing the message payload. This implementation has several improvements over the implementation on which it is based:

Servers

gwt-comet takes advantage of Glassfish’s and embedded Grizzly’s support for non-blocking sending and receiving and a pool of threads servicing the Comet connections.

Otherwise by default standard servlets are supported requiring one thread per Comet connection which will work on any Java web application server.

Downloads

There are a few downloads:

Getting Started

https://code.google.com/p/gwt-comet/wiki/GettingStarted