- cout << "simple_tests" << endl;
- // an RPC call to procedure #22.
- // rpcc::call() looks at the argument types to decide how
- // to marshall the RPC call packet, and how to unmarshall
- // the reply packet.
- string rep;
- int intret = c->call(22, rep, (string)"hello", (string)" goodbye");
- VERIFY(intret == 0); // this is what handle_22 returns
- VERIFY(rep == "hello goodbye");
- cout << " -- string concat RPC .. ok" << endl;
-
- // small request, big reply (perhaps req via UDP, reply via TCP)
- intret = c->call_timeout(25, rpcc::to(200000), rep, 70000);
- VERIFY(intret == 0);
- VERIFY(rep.size() == 70000);
- cout << " -- small request, big reply .. ok" << endl;
-
- // specify a timeout value to an RPC that should succeed (udp)
- int xx = 0;
- intret = c->call_timeout(23, rpcc::to(3000), xx, 77);
- VERIFY(intret == 0 && xx == 78);
- cout << " -- no spurious timeout .. ok" << endl;
-
- // specify a timeout value to an RPC that should succeed (tcp)
- {
- string arg(1000, 'x');
- string rep2;
- c->call_timeout(22, rpcc::to(3000), rep2, arg, (string)"x");
- VERIFY(rep2.size() == 1001);
- cout << " -- no spurious timeout .. ok" << endl;
- }
-
- // huge RPC
- string big(1000000, 'x');
- intret = c->call(22, rep, big, (string)"z");
- VERIFY(rep.size() == 1000001);
- cout << " -- huge 1M rpc request .. ok" << endl;
-
- // specify a timeout value to an RPC that should timeout (udp)
+ cout << "simple_tests" << endl;
+ // an RPC call to procedure #22.
+ // rpcc::call() looks at the argument types to decide how
+ // to marshall the RPC call packet, and how to unmarshall
+ // the reply packet.
+ string rep;
+ int intret = c->call(22, rep, (string)"hello", (string)" goodbye");
+ VERIFY(intret == 0); // this is what handle_22 returns
+ VERIFY(rep == "hello goodbye");
+ cout << " -- string concat RPC .. ok" << endl;
+
+ // small request, big reply (perhaps req via UDP, reply via TCP)
+ intret = c->call_timeout(25, rpcc::to(20000), rep, 70000);
+ VERIFY(intret == 0);
+ VERIFY(rep.size() == 70000);
+ cout << " -- small request, big reply .. ok" << endl;
+
+ // specify a timeout value to an RPC that should succeed (udp)
+ int xx = 0;
+ intret = c->call_timeout(23, rpcc::to(300), xx, 77);
+ VERIFY(intret == 0 && xx == 78);
+ cout << " -- no spurious timeout .. ok" << endl;
+
+ // specify a timeout value to an RPC that should succeed (tcp)
+ {
+ string arg(1000, 'x');
+ string rep2;
+ c->call_timeout(22, rpcc::to(300), rep2, arg, (string)"x");
+ VERIFY(rep2.size() == 1001);
+ cout << " -- no spurious timeout .. ok" << endl;
+ }
+
+ // huge RPC
+ string big(1000000, 'x');
+ intret = c->call(22, rep, big, (string)"z");
+ VERIFY(rep.size() == 1000001);
+ cout << " -- huge 1M rpc request .. ok" << endl;
+
+ // specify a timeout value to an RPC that should timeout (udp)