public class EventCometContext extends Object implements CometContext
{
key: 121648764328,
nexteventid: 56785,
channels: [ "tehchannel", "morechannel", "thingydoodle" ],
lingertime: 1500, // Linger time in ms, optional.
}
| Modifier and Type | Class and Description |
|---|---|
static class |
EventCometContext.EventResult |
| Constructor and Description |
|---|
EventCometContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
begin(javax.servlet.http.HttpServlet slet,
javax.servlet.http.HttpServletRequest req,
Continuation cont) |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest() |
String |
getRemoteUser() |
void |
respond(javax.servlet.http.HttpServletResponse resp,
boolean timeout)
Called when the condition we're waiting for has been fulfilled.
|
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
public void begin(javax.servlet.http.HttpServlet slet,
javax.servlet.http.HttpServletRequest req,
Continuation cont)
throws Exception
begin in interface CometContextExceptionpublic void respond(javax.servlet.http.HttpServletResponse resp,
boolean timeout)
throws Exception
{
key: 2131244, // This server's key. Must be repeated in the next request
nexteventid: 2131, // The last event ID seen. Must be passed in the next request,
status: "eventcode", // The status of the call (see below)
eventlist: [ // Optional, only if events are found
{
channel: "channelname",
eventid: 2131,
data: .... // Whatever event data was present
},
// repeatedly
]
}
respond in interface CometContextExceptionCometContext.respond(javax.servlet.http.HttpServletResponse, boolean)public String getRemoteUser()
Copyright © 2017 etc.to. All rights reserved.