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

Method SampleServer

src/examples/redisserver.cpp:19–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17class SampleServer : public AbstractServer<SampleServer> {
18public:
19 SampleServer(RedisServer &server) : AbstractServer<SampleServer>(server) {
20 this->bindAndAddMethod(Procedure("sayHello", PARAMS_BY_NAME, JSON_STRING, "name", JSON_STRING, NULL), &SampleServer::sayHello);
21 this->bindAndAddNotification(Procedure("notifyServer", PARAMS_BY_NAME, NULL), &SampleServer::notifyServer);
22 }
23
24 // method
25 void sayHello(const Json::Value &request, Json::Value &response) { response = "Hello: " + request["name"].asString(); }

Callers

nothing calls this directly

Calls 3

ProcedureClass · 0.50
bindAndAddMethodMethod · 0.45

Tested by

no test coverage detected