Application needs to implement an application client class inheriting from ServiceEndpointDiscoveryClient. In its own class, application needs to override callback methods it desires to use for receiving responses. Default empty callback methods are implemented by ServiceEndpointDiscoveryClient class.
The following code snippet shows basic usage of ServiceEndpointDiscoveryClient class to print recevied messages to screen.
{
void onSuccess(
const ServiceEndpointDiscoveryResp& ,
const ServiceEndpointDiscoveryEvent& );
void onError(
const EmaString& errorText,
const ServiceEndpointDiscoveryEvent& )
};
void AppClient::onSuccess( const ServiceEndpointDiscoveryResp& serviceEndpointResp, const ServiceEndpointDiscoveryEvent& event)
{
cout << serviceEndpointResp << endl;
}
void AppClient::onError(const EmaString& errorText, const ServiceEndpointDiscoveryEvent& event)
{
cout << errorText << endl;
}
virtual void onError(const EmaString &errorText, const ServiceEndpointDiscoveryEvent &event)
virtual void onSuccess(const ServiceEndpointDiscoveryResp &serviceEndpointResp, const ServiceEndpointDiscoveryEvent &event)
ServiceEndpointDiscoveryClient()
- See also
- ServiceEndpointDiscovery, ServiceEndpointDiscoveryResp, ServiceEndpointDiscoveryEvent,
Definition at line 60 of file ServiceEndpointDiscoveryClient.h.