产品 |
是否支持 |
---|---|
x |
|
√ |
|
x |
|
x |
|
x |
创建Service的服务端。
1 | template <typename ReqType, typename ResType> std::shared_ptr<OpenHiva::ServiceServer> CreateServer(const std::string &serviceName, const OpenHiva::ServiceOptions &serviceOptions, const std::function<bool(ReqType, ResType)> &serviceCallback) |
参数名 |
输入/输出 |
说明 |
---|---|---|
serviceName |
输入 |
服务名。 |
serviceOptions |
输入 |
Service属性配置,详见OpenHiva::ServiceOptions类型定义。 |
serviceCallback |
输入 |
Server收到消息后调用的回调函数,用于处理Client端发布的消息。 |
返回OpenHiva::ServiceServer对象,可通过该对象完成服务端的初始化及资源释放。