public abstract class Comet extends Results.Chunks<java.lang.String>
Results.Chunks.Out<A>
Constructor and Description |
---|
Comet(java.lang.String callbackMethod)
Create a new Comet socket
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the channel
|
protected java.lang.String |
initialBuffer()
Initial chunk of data to send for browser compatibility (default to send 5Kb of blank data).
|
abstract void |
onConnected()
The socket is ready, you can start sending messages.
|
void |
onDisconnected(F.Callback0 callback)
Add a callback to be notified when the client has disconnected.
|
void |
onReady(Results.Chunks.Out<java.lang.String> out)
Called when the Chunked stream is ready.
|
void |
sendMessage(org.codehaus.jackson.JsonNode message)
Send a Json message on this socket (will be received as Json in the Javascript callback method).
|
void |
sendMessage(java.lang.String message)
Send a message on this socket (will be received as String in the Javascript callback method).
|
public Comet(java.lang.String callbackMethod)
callbackMethod
- The Javascript callback method to call on each message.public void onReady(Results.Chunks.Out<java.lang.String> out)
Results.Chunks
onReady
in class Results.Chunks<java.lang.String>
out
- The out stream.protected java.lang.String initialBuffer()
public void sendMessage(java.lang.String message)
public void sendMessage(org.codehaus.jackson.JsonNode message)
public abstract void onConnected()
public void onDisconnected(F.Callback0 callback)
public void close()