rpcs *server; // server rpc object
rpcc *clients[NUM_CL]; // client rpc object
struct sockaddr_in dst; //server's ip address
rpcs *server; // server rpc object
rpcc *clients[NUM_CL]; // client rpc object
struct sockaddr_in dst; //server's ip address
int handle_22(std::string & r, const std::string a, const std::string b);
int handle_fast(int &r, const int a);
int handle_slow(int &r, const int a);
int handle_22(std::string & r, const std::string a, const std::string b);
int handle_fast(int &r, const int a);
int handle_slow(int &r, const int a);
server->reg(22, &srv::handle_22, &service);
server->reg(23, &srv::handle_fast, &service);
server->reg(24, &srv::handle_slow, &service);
server->reg(22, &srv::handle_22, &service);
server->reg(23, &srv::handle_fast, &service);
server->reg(24, &srv::handle_slow, &service);
int ret = clients[which_cl]->call(which ? 23 : 24, rep, arg);
auto end = std::chrono::steady_clock::now();
int ret = clients[which_cl]->call(which ? 23 : 24, rep, arg);
auto end = std::chrono::steady_clock::now();
// specify a timeout value to an RPC that should succeed (tcp)
{
std::string arg(1000, 'x');
// specify a timeout value to an RPC that should succeed (tcp)
{
std::string arg(1000, 'x');
- std::string rep;
- c->call_timeout(22, rpcc::to(3000), rep, arg, (std::string)"x");
- VERIFY(rep.size() == 1001);
+ std::string rep2;
+ c->call_timeout(22, rpcc::to(3000), rep2, arg, (std::string)"x");
+ VERIFY(rep2.size() == 1001);
{
// create threads that make lots of calls in parallel,
// to test thread synchronization for concurrent calls
// and dispatches.
{
// create threads that make lots of calls in parallel,
// to test thread synchronization for concurrent calls
// and dispatches.
VERIFY (client->bind() >= 0);
printf(" -- delete existing rpc client and server, create replacements.. ok\n");
VERIFY (client->bind() >= 0);
printf(" -- delete existing rpc client and server, create replacements.. ok\n");
- printf(" -- concurrent test on new client and server w/ %d threads ..", nt);
- for(int i = 0; i < nt; i++){
+ printf(" -- concurrent test on new client and server w/ %lu threads ..", nt);
+
+ for(size_t i = 0; i < nt; i++)