class IO2GResponseListener

Parents
IAddRef

Brief

The interface provides method signatures to process notifications about request completions, request failures and tables updates.

Details

The interface must be implemented by an application in order to process the trading server responses. Responses come from the trading server in two ways:

For complete details of processing the response contents, refer to the IO2GResponse class documentation.

If you want to use the methods of the IO2GResponseListener interface, you must create a class that implements the interface. For example,
class ResponseListener : public IO2GResponseListener { }

An instance of the class implementing the IO2GResponseListener interface must be subscribed to a session object. It is accomplished by calling the IO2GSession.subscribeResponse method. For example,
mSession = CO2GTransport::createSession();
O2G2Ptr<ResponseListener> responseListener = new ResponseListener(mSession);
mSession->subscribeResponse(responseListener);

The subscribed instance must be unsubscribed from a session object after calling the IO2GSession.logout method. It is accomplished by calling the IO2GSession.unsubscribeResponse method.
For example,

mSession->logout();
mSession->unsubscribeResponse(responseListener);

For the interface implementation details, see the example below.

Example

Process notifications about the request to get offers and live offers updates [show]

Public Methods

onRequestCompleted

Processes a notification about the successful request completion.

onRequestFailed

Processes notification about a request failure.

onTablesUpdates

Processes notifications about tables updates.

back