OpenHiva::ServiceClient

OpenHiva::ServiceClient functions as the client of Server-Client, sends requests to the server, and waits for the processing result from the server.

OpenHiva::ServiceClient is created by invoking OpenHiva::Node::CreateClient, which returns an initialized OpenHiva::ServiceClient object.

1
2
3
4
5
6
7
8
namespace OpenHiva {
class ServiceClient {
public:
    template <typename ReqType, typename ResType>
    uint32_t InvokeService(ReqType req, ResType &res, const uint32_t timeout = 5000U); // Send a message of the ReqType type to the Server and wait for the message response.
    void Destroy();         // Release the resources that the ServiceClient applies for.
};
}