MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / main

Function main

src/examples/redisclient.cpp:16–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace std;
15
16int main() {
17
18 execlp("redis-server", "redis-server", "-v", NULL);
19
20 RedisClient client("127.0.0.1", 6379, "example");
21 client.SetTimeout(1);
22 Client c(client);
23
24 Json::Value params;
25 params["name"] = "Peter";
26 Json::Value params2;
27
28 try {
29 cout << c.CallMethod("sayHello", params) << endl;
30 c.CallNotification("notifyServer", params2);
31 } catch (JsonRpcException &e) {
32 cerr << e.what() << endl;
33 }
34}

Callers

nothing calls this directly

Calls 4

CallMethodMethod · 0.80
CallNotificationMethod · 0.80
SetTimeoutMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected