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

Method SampleServer

src/examples/filedescriptorserver.cpp:46–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44class SampleServer : public AbstractServer<SampleServer> {
45public:
46 SampleServer(FileDescriptorServer &server) : AbstractServer<SampleServer>(server) {
47 this->bindAndAddMethod(Procedure("sayHello", PARAMS_BY_NAME, JSON_STRING, "name", JSON_STRING, NULL), &SampleServer::sayHello);
48 this->bindAndAddNotification(Procedure("notifyServer", PARAMS_BY_NAME, NULL), &SampleServer::notifyServer);
49 }
50
51 // method
52 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