Lightstreamer C++ Client SDK
|
Interface to be implemented to listen to LightstreamerClient
events comprehending notifications of connection activity and errors.
More...
#include <ClientListener.h>
Public Member Functions | |
virtual void | onListenEnd () |
Event handler that receives a notification when the ClientListener instance is removed from a LightstreamerClient through LightstreamerClient#removeListener() . | |
virtual void | onListenStart () |
Event handler that receives a notification when the ClientListener instance is added to a LightstreamerClient through LightstreamerClient#addListener() . | |
virtual void | onServerError (int errorCode, const std::string &errorMessage) |
Event handler that is called when the Server notifies a refusal on the client attempt to open a new connection or the interruption of a streaming connection. | |
virtual void | onStatusChange (const std::string &status) |
Event handler that receives a notification each time the LightstreamerClient status has changed. | |
virtual void | onPropertyChange (const std::string &property) |
Event handler that receives a notification each time the value of a property of LightstreamerClient#connectionDetails or LightstreamerClient#connectionOptions is changed. | |
Interface to be implemented to listen to LightstreamerClient
events comprehending notifications of connection activity and errors.
Events for these listeners are dispatched by a different thread than the one that generates them. This means that, upon reception of an event, it is possible that the internal state of the client has changed. On the other hand, all the notifications for a single LightstreamerClient, including notifications to ClientListener
s, SubscriptionListener
s and ClientMessageListener
s will be dispatched by the same thread.
|
inlinevirtual |
Event handler that receives a notification when the ClientListener instance is removed from a LightstreamerClient through LightstreamerClient#removeListener()
.
This is the last event to be fired on the listener.
|
inlinevirtual |
Event handler that receives a notification when the ClientListener instance is added to a LightstreamerClient through LightstreamerClient#addListener()
.
This is the first event to be fired on the listener.
|
inlinevirtual |
Event handler that receives a notification each time the value of a property of LightstreamerClient#connectionDetails
or LightstreamerClient#connectionOptions
is changed.
Properties of these objects can be modified by direct calls to them or by server sent events.
property | the name of the changed property. Possible values are:
|
|
inlinevirtual |
Event handler that is called when the Server notifies a refusal on the client attempt to open a new connection or the interruption of a streaming connection.
In both cases, the onStatusChange
event handler has already been invoked with a "DISCONNECTED" status and no recovery attempt has been performed. By setting a custom handler, however, it is possible to override this and perform custom recovery actions.
errorCode | The error code. It can be one of the following:
|
errorMessage | The description of the error as sent by the Server. |
|
inlinevirtual |
Event handler that receives a notification each time the LightstreamerClient status has changed.
The status changes may be originated either by custom actions (e.g. by calling LightstreamerClient#disconnect
) or by internal actions. The normal cases are the following:
LightstreamerClient#disconnect
, the status will switch to "DISCONNECTED". onServerError
event handler will be invoked. Possible special cases are the following:
ConnectionOptions#setStalledTimeout(long)
). If the unavailability ceases, the status will switch back to "CONNECTED:*-STREAMING"; otherwise, if the unavailability persists (see ConnectionOptions#setReconnectTimeout(long)
), the status will switch to "DISCONNECTED:TRYING-RECOVERY" and eventually to "CONNECTED:*-STREAMING". onServerError
event handler will be invoked. ConnectionOptions#setSlowingEnabled()
, in case of slow update processing, the status may switch from "CONNECTED:WS-STREAMING" to "CONNECTED:WS-POLLING" or from "CONNECTED:HTTP-STREAMING" to "CONNECTED:HTTP-POLLING". ConnectionOptions#setForcedTransport()
, only the related final status or statuses are possible. ConnectionOptions#setRetryDelay(long)
), then to "CONNECTING" and a new attempt will start. However, in most cases, the client will try to recover the current session; hence, the "DISCONNECTED:TRYING-RECOVERY" status will be entered and the recovery attempt will start. By setting a custom handler it is possible to perform actions related to connection and disconnection occurrences. Note that LightstreamerClient#connect
and LightstreamerClient#disconnect
, as any other method, can be issued directly from within a handler.
status | The new status. It can be one of the following values:
|