OpenHiva::Node::CreateClient
函数功能
创建Service的客户端。
函数原型
template <typename ReqType, typename ResType> std::shared_ptr<OpenHiva::ServiceClient> CreateClient(const std::string &serviceName, const ServiceOptions &serviceOptions)
参数说明
参数名 |
输入/输出 |
说明 |
---|---|---|
serviceName |
输入 |
服务名。 |
serviceOptions |
输入 |
Service属性配置,详见OpenHiva::ServiceOptions类型定义。 |
返回值
返回OpenHiva::ServiceClient对象,可通过该对象完成客户端的初始化及资源释放,也可向服务端发送消息并获取服务端响应的结果。
使用说明
无
注意事项
- 本接口不可重入,同步接口。
- ReqType描述请求的消息类型,必须是HivaMessage的子类。
- ResType描述响应的消息类型,必须是HivaMessage的子类。
父主题: OpenHiva::Node接口