public class AckExtension extends ClientSession.Extension.Adapter
This client-side extension enables the client to acknowledge to the server the messages that the client has received.
For the acknowledgement to work, the server must be configured with the correspondent server-side ack extension. If both client and server support the ack extension, then the ack functionality will take place automatically. By enabling this extension, all messages arriving from the server will arrive via the long poll, so the comet communication will be slightly chattier. The fact that all messages will return via long poll means also that the messages will arrive with total order, which is not guaranteed if messages can arrive via both long poll and normal response. Messages are not acknowledged one by one, but instead a group of messages is acknowledged when long poll returns.
ClientSession.Extension.Adapter
Constructor and Description |
---|
AckExtension() |
Modifier and Type | Method and Description |
---|---|
boolean |
rcv(ClientSession session,
Message.Mutable message) |
boolean |
rcvMeta(ClientSession session,
Message.Mutable message) |
boolean |
sendMeta(ClientSession session,
Message.Mutable message) |
send
public static final String ACK_FIELD
public boolean rcvMeta(ClientSession session, Message.Mutable message)
rcvMeta
in interface ClientSession.Extension
rcvMeta
in class ClientSession.Extension.Adapter
public boolean rcv(ClientSession session, Message.Mutable message)
rcv
in interface ClientSession.Extension
rcv
in class ClientSession.Extension.Adapter
public boolean sendMeta(ClientSession session, Message.Mutable message)
sendMeta
in interface ClientSession.Extension
sendMeta
in class ClientSession.Extension.Adapter
Copyright © 2008–2017 The CometD Project. All rights reserved.