| 14 | using namespace std; |
| 15 | |
| 16 | int main(int argc, char **argv) { |
| 17 | string host; |
| 18 | unsigned int port; |
| 19 | |
| 20 | if (argc == 3) { |
| 21 | host = string(argv[1]); |
| 22 | port = atoi(argv[2]); |
| 23 | } else { |
| 24 | host = "127.0.0.1"; |
| 25 | port = 6543; |
| 26 | } |
| 27 | |
| 28 | cout << "Params are :" << endl; |
| 29 | cout << "\t host: " << host << endl; |
| 30 | cout << "\t port: " << port << endl; |
| 31 | |
| 32 | TcpSocketClient client(host, port); |
| 33 | Client c(client); |
| 34 | |
| 35 | Json::Value params; |
| 36 | params["name"] = "Peter"; |
| 37 | |
| 38 | try { |
| 39 | cout << c.CallMethod("sayHello", params) << endl; |
| 40 | } catch (JsonRpcException &e) { |
| 41 | cerr << e.what() << endl; |
| 42 | } |
| 43 | } |
nothing calls this directly
no test coverage detected