| 93 | } |
| 94 | |
| 95 | void invokeStringMethodSync(jcon::JsonRpcClient* rpc_client) |
| 96 | { |
| 97 | qsrand(std::time(nullptr)); |
| 98 | |
| 99 | auto result = rpc_client->call("printMessage", "hello, world"); |
| 100 | |
| 101 | if (result->isSuccess()) { |
| 102 | qDebug() << "result of synchronous RPC call:" << result->result(); |
| 103 | } else { |
| 104 | qDebug() << "RPC error:" << result->toString(); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | void invokeNotification(jcon::JsonRpcClient *rpc_client) { |
| 109 | rpc_client->notification("printNotification", "hello, world Notification"); |