--- libaitrpc/example/tcli2.c 2014/12/11 00:07:21 1.1.2.2 +++ libaitrpc/example/tcli2.c 2019/08/15 14:59:18 1.3.6.1 @@ -1,7 +1,9 @@ #include +#include +#include #include #include -#include +#include #include "rc.h" @@ -23,30 +25,27 @@ int main(int argc, char **argv) return 1; } -#if 0 +//#if 0 printf("\n\n1 pass>>> RPC ping\n\n"); for (i = 0; i < 1000; i++) { gettimeofday(&before, NULL); if ((ret = rpc_cli_ping(cli)) == -1) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); - rpc_cli_closeBLOBClient(&cli2); rpc_cli_closeClient(&cli); - e_free(blob43); return 127; } gettimeofday(&after, NULL); printf("RPC ping seq[0x%04x] #%d --- %f\n", ret, i, (after.tv_sec - before.tv_sec) + (after.tv_usec - before.tv_usec) / 1.e6); } +//#endif //#if 0 printf("\n\n2 pass>>> RPC ping without reply!!!\n\n"); for (i = 0; i < 10; i++) { gettimeofday(&before, NULL); - if (rpc_cli_execCall(cli, RPC_NOREPLY, CALL_SRVPING, NULL, &arr)) { + if (rpc_cli_execCall(cli, RPC_NOREPLY, CALL_SRVPING, NULL, &arr) == -1) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); - rpc_cli_closeBLOBClient(&cli2); - rpc_cli_closeClient(&cli); - e_free(blob43); + rpc_cli_closeClient2(&cli); return 127; } gettimeofday(&after, NULL); @@ -54,27 +53,23 @@ int main(int argc, char **argv) printf("RPC ping #%d --- %f\n", i, (after.tv_sec - before.tv_sec) + (after.tv_usec - before.tv_usec) / 1.e6); } -#if 0 +//#if 0 printf("\n\n3 pass>>> RPC ping\n\n"); for (i = 0; i < 10000; i++) { gettimeofday(&before, NULL); if ((ret = rpc_cli_ping(cli)) == -1) { printf("error %d:: errno=%d %s\n", i, rpc_GetErrno(), rpc_GetError()); - rpc_cli_closeBLOBClient(&cli2); rpc_cli_closeClient(&cli); - e_free(blob43); return 127; } gettimeofday(&after, NULL); printf("RPC ping seq[0x%04x] #%d --- %f\n", ret, i, (after.tv_sec - before.tv_sec) + (after.tv_usec - before.tv_usec) / 1.e6); } -#endif //#endif +//#endif - memset(blob43, 0, 512); - strlcpy(blob43, "aaaaaaaaaaaaaaa cddddddddddddddd zzzzzzzzzzzzzzzzzzzzz !!!!\n\n\n675675676...\n", 512); - +#if 0 valz = ait_allocVars(3); v = array(valz, 0, ait_val_t*); AIT_SET_I32(v, 12345678);