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:
A response provided by the server as an answer to a user request.
Requests may be successfully completed or failed:
- to process notifications about successful requests completion, you must use the onRequestCompleted method;
- to process notifications about requests failures, you must use the onRequestFailed method.
A response provided by the server as a result of trading tables updates.
To process these notifications, you must use the
onTablesUpdates method.
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 | |
Processes a notification about the successful request completion. |
|
Processes notification about a request failure. |
|
Processes notifications about tables updates. |