version 1.7.4.5, 2012/05/17 12:53:01
|
version 1.7.4.18, 2012/05/18 15:37:58
|
Line 4
|
Line 4
|
#include "rc.h" |
#include "rc.h" |
|
|
|
|
int main() | int main(int argc, char **argv) |
{ |
{ |
rpc_cli_t *cli = NULL, *cli2 = NULL; |
rpc_cli_t *cli = NULL, *cli2 = NULL; |
int c, i, ret; |
int c, i, ret; |
Line 20 int main()
|
Line 20 int main()
|
return 1; |
return 1; |
} |
} |
|
|
|
cli2 = rpc_cli_openBLOBClient(cli, 0); |
|
if (!cli2) { |
|
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
|
rpc_cli_closeClient(&cli); |
|
free(blob43); |
|
return 1; |
|
} |
|
|
|
printf("\n\n1 pass>>> RPC ping\n\n"); |
for (i = 0; i < 10000; i++) { |
for (i = 0; i < 10000; i++) { |
gettimeofday(&before, NULL); |
gettimeofday(&before, NULL); |
if (rpc_cli_execCall(cli, RPC_REPLY, CALL_SRVPING, NULL, &arr)) { | if ((ret = rpc_cli_ping(cli)) == -1) { |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
|
rpc_cli_closeBLOBClient(&cli2); |
rpc_cli_closeClient(&cli); |
rpc_cli_closeClient(&cli); |
free(blob43); |
free(blob43); |
return 127; |
return 127; |
} |
} |
gettimeofday(&after, NULL); |
gettimeofday(&after, NULL); |
printf("RPC ping seq[0x%04x] #%d --- %f\n", AIT_GET_U16(io_array(arr, 0, ait_val_t*)), | printf("RPC ping seq[0x%04x] #%d --- %f\n", ret, i, |
i, (after.tv_sec - before.tv_sec) + (after.tv_usec - before.tv_usec) / 1.e6); | (after.tv_sec - before.tv_sec) + (after.tv_usec - before.tv_usec) / 1.e6); |
io_freeVars(&arr); | |
} |
} |
printf("\n\n>>> RPC ping without reply!!!\n\n"); | printf("\n\n2 pass>>> RPC ping without reply!!!\n\n"); |
for (i = 0; i < 10000; i++) { |
for (i = 0; i < 10000; i++) { |
gettimeofday(&before, NULL); |
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)) { |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); |
|
rpc_cli_closeBLOBClient(&cli2); |
rpc_cli_closeClient(&cli); |
rpc_cli_closeClient(&cli); |
free(blob43); |
free(blob43); |
return 127; |
return 127; |
Line 47 int main()
|
Line 57 int main()
|
printf("RPC ping #%d --- %f\n", i, (after.tv_sec - before.tv_sec) + |
printf("RPC ping #%d --- %f\n", i, (after.tv_sec - before.tv_sec) + |
(after.tv_usec - before.tv_usec) / 1.e6); |
(after.tv_usec - before.tv_usec) / 1.e6); |
} |
} |
| printf("\n\n3 pass>>> RPC ping\n\n"); |
cli2 = rpc_cli_openBLOBClient(cli, 0); | for (i = 0; i < 10000; i++) { |
if (!cli2) { | gettimeofday(&before, NULL); |
printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); | if ((ret = rpc_cli_ping(cli)) == -1) { |
rpc_cli_closeClient(&cli); | printf("error %d:: errno=%d %s\n", i, rpc_GetErrno(), rpc_GetError()); |
free(blob43); | rpc_cli_closeBLOBClient(&cli2); |
return 1; | rpc_cli_closeClient(&cli); |
| 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); |
} |
} |
|
|
memset(blob43, 0, 512); |
memset(blob43, 0, 512); |
Line 225 int main()
|
Line 241 int main()
|
AIT_GET_U8(io_array(arr, 2, ait_val_t*)), AIT_GET_I32(io_array(arr, 3, ait_val_t*))); |
AIT_GET_U8(io_array(arr, 2, ait_val_t*)), AIT_GET_I32(io_array(arr, 3, ait_val_t*))); |
io_freeVars(&arr); |
io_freeVars(&arr); |
|
|
rpc_cli_execCall(cli, RPC_NOREPLY, CALL_SRVSHUTDOWN, NULL, NULL); | if (argc > 1) |
| rpc_cli_execCall(cli, RPC_NOREPLY, CALL_SRVSHUTDOWN, NULL, NULL); |
|
|
rpc_cli_closeBLOBClient(&cli2); |
rpc_cli_closeBLOBClient(&cli2); |
rpc_cli_closeClient(&cli); |
rpc_cli_closeClient(&cli); |