gwt-gae-channel-1.0-20010325

Version 1 by Bartolomeo Sorrentino
on Jun 18, 2011 09:43.

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (3)

View page history
{panel}
h2. Introduction
First of all, you should read and be familiar with how to use the App Engine Channel API [java|http://code.google.com/appengine/docs/java/channel/] on the server-side.
 
This library simply wraps the client-side JavaScript with GWT bindings to make it accessible in a GWT application, and it doesn't manage telling your client the client ID it should use. That part's up to you, and is described in the documentation for the Channel API.
 
h2. A Short Sample
The following is a simple example of how to open a channel and receive updates when the channel receives a message.

{code:java}

ChannelFactory.createChannel(token, new ChannelCreatedCallback() {
@Override
public void onChannelCreated(Channel channel) {
channel.open(new SocketListener() {
@Override
public void onOpen() {
Window.alert("Channel opened!");
}
@Override
public void onMessage(String message) {
Window.alert("Received: " + message);
}
@Override
public void onError(SocketError error) {
Window.alert("Error: " + error.getDescription());
}
@Override
public void onClose() {
Window.alert("Channel closed!");
}
});
}
});

{code}

Whenever the server sends a message to your client ID, the onMessage() method will get called with the message that was sent.

h1. Project Summary
{anchor:Project_Summary} h2. Project Information