X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/603bac8fcb3697f283e6537d81b4a92e457ebbad..3abd3952c1f4441f0dd6eae9883b2d01ed9cd56b:/rpc/rpctest.cc diff --git a/rpc/rpctest.cc b/rpc/rpctest.cc index 2f58e5d..723df82 100644 --- a/rpc/rpctest.cc +++ b/rpc/rpctest.cc @@ -166,7 +166,7 @@ client3(void *xx) for(int i = 0; i < 4; i++){ int rep = 0; - int ret = c->call_timeout(24, rpcc::to(300), rep, i); + int ret = c->call_timeout(24, milliseconds(300), rep, i); VERIFY(ret == rpc_const::timeout_failure || rep == i+2); } } @@ -187,14 +187,14 @@ simple_tests(rpcc *c) 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); + intret = c->call_timeout(25, milliseconds(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); + intret = c->call_timeout(23, milliseconds(300), xx, 77); VERIFY(intret == 0 && xx == 78); cout << " -- no spurious timeout .. ok" << endl; @@ -202,7 +202,7 @@ simple_tests(rpcc *c) { string arg(1000, 'x'); string rep2; - c->call_timeout(22, rpcc::to(300), rep2, arg, (string)"x"); + c->call_timeout(22, milliseconds(300), rep2, arg, (string)"x"); VERIFY(rep2.size() == 1001); cout << " -- no spurious timeout .. ok" << endl; } @@ -217,7 +217,7 @@ simple_tests(rpcc *c) string non_existent = "127.0.0.1:7661"; rpcc *c1 = new rpcc(non_existent); time_t t0 = time(0); - intret = c1->bind(rpcc::to(300)); + intret = c1->bind(milliseconds(300)); time_t t1 = time(0); VERIFY(intret < 0 && (t1 - t0) <= 4); cout << " -- rpc timeout .. ok" << endl; @@ -285,7 +285,7 @@ failure_test() delete server; client1 = new rpcc(dst); - VERIFY (client1->bind(rpcc::to(3000)) < 0); + VERIFY (client1->bind(milliseconds(3000)) < 0); cout << " -- create new client and try to bind to failed server .. failed ok" << endl; delete client1;