Lightstreamer C++ Client SDK
Loading...
Searching...
No Matches
Lightstreamer::ClientMessageListener Class Reference

Interface to be implemented to listen to LightstreamerClient#sendMessage events reporting a message processing outcome. More...

#include <ClientMessageListener.h>

Public Member Functions

virtual void onAbort (const std::string &originalMessage, bool sentOnNetwork)
 Event handler that is called by Lightstreamer when any notifications of the processing outcome of the related message haven't been received yet and can no longer be received.
 
virtual void onDeny (const std::string &originalMessage, int code, const std::string &error)
 Event handler that is called by Lightstreamer when the related message has been processed by the Server but the expected processing outcome could not be achieved for any reason.
 
virtual void onDiscarded (const std::string &originalMessage)
 Event handler that is called by Lightstreamer to notify that the related message has been discarded by the Server.
 
virtual void onError (const std::string &originalMessage)
 Event handler that is called by Lightstreamer when the related message has been processed by the Server but the processing has failed for any reason.
 
virtual void onProcessed (const std::string &originalMessage, const std::string &response)
 Event handler that is called by Lightstreamer when the related message has been processed by the Server with success.
 

Detailed Description

Interface to be implemented to listen to LightstreamerClient#sendMessage events reporting a message processing outcome.

Events for these listeners are dispatched by a different thread than the one that generates them. All the notifications for a single LightstreamerClient, including notifications to ClientListeners, SubscriptionListeners and ClientMessageListeners will be dispatched by the same thread. Only one event per message is fired on this listener.

Member Function Documentation

◆ onAbort()

virtual void Lightstreamer::ClientMessageListener::onAbort ( const std::string & originalMessage,
bool sentOnNetwork )
inlinevirtual

Event handler that is called by Lightstreamer when any notifications of the processing outcome of the related message haven't been received yet and can no longer be received.

Typically, this happens after the session has been closed. In this case, the client has no way of knowing the processing outcome and any outcome is possible.

Parameters
originalMessagethe message to which this notification is related.
sentOnNetworktrue if the message was sent on the network, false otherwise. Even if the flag is true, it is not possible to infer whether the message actually reached the Lightstreamer Server or not.

◆ onDeny()

virtual void Lightstreamer::ClientMessageListener::onDeny ( const std::string & originalMessage,
int code,
const std::string & error )
inlinevirtual

Event handler that is called by Lightstreamer when the related message has been processed by the Server but the expected processing outcome could not be achieved for any reason.

Parameters
originalMessagethe message to which this notification is related.
codethe error code sent by the Server. It can be one of the following:
  • <= 0 - the Metadata Adapter has refused the message; the code value is dependent on the specific Metadata Adapter implementation.
errorthe description of the error sent by the Server.

◆ onDiscarded()

virtual void Lightstreamer::ClientMessageListener::onDiscarded ( const std::string & originalMessage)
inlinevirtual

Event handler that is called by Lightstreamer to notify that the related message has been discarded by the Server.

This means that the message has not reached the Metadata Adapter and the message next in the sequence is considered enabled for processing.

Parameters
originalMessagethe message to which this notification is related.

◆ onError()

virtual void Lightstreamer::ClientMessageListener::onError ( const std::string & originalMessage)
inlinevirtual

Event handler that is called by Lightstreamer when the related message has been processed by the Server but the processing has failed for any reason.

The level of completion of the processing by the Metadata Adapter cannot be determined.

Parameters
originalMessagethe message to which this notification is related.

◆ onProcessed()

virtual void Lightstreamer::ClientMessageListener::onProcessed ( const std::string & originalMessage,
const std::string & response )
inlinevirtual

Event handler that is called by Lightstreamer when the related message has been processed by the Server with success.

Parameters
originalMessagethe message to which this notification is related.
responsethe response from the Metadata Adapter. If not supplied (i.e. supplied as null), an empty message is received here.

The documentation for this class was generated from the following file: