--- libaitrpc/example/tcli.c 2013/07/16 13:04:20 1.14 +++ libaitrpc/example/tcli.c 2013/08/23 00:09:50 1.15.2.1 @@ -16,8 +16,10 @@ int main(int argc, char **argv) // printf("MM model=%d\n", elwix_mm_inuse()); // getchar(); - cli = rpc_cli_openClient(2, 1024 * 10, "127.0.0.1", 11111, SOCK_DGRAM); -// cli = rpc_cli_openClient(2, 1024 * 10, "127.0.0.1", 11111, 0); + if (argc > 1) + cli = rpc_cli_openClient(2, 1024 * 10, "127.0.0.1", 11111, SOCK_DGRAM); + else + cli = rpc_cli_openClient(2, 1024 * 10, "127.0.0.1", 11111, 0); if (!cli) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); e_free(blob43); @@ -147,7 +149,14 @@ int main(int argc, char **argv) } printf("return=%d aaa arr=%p\n", arr ? array_Size(arr) : 42424242, arr); + if (rpc_cli_execCall(cli, RPC_REPLY, RC_big, NULL, &arr) < 0) { + printf("error:: \"big\" errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); + return 3; + } + printf("return=%d big arr=%p\n", arr ? array_Size(arr) : 42424242, arr); + ait_freeVars(&arr); + valz = ait_allocVars(1); v = array(valz, 0, ait_val_t*); AIT_SET_DATA(v, "1234567890", 11); @@ -248,7 +257,8 @@ int main(int argc, char **argv) AIT_GET_U8(array(arr, 1, ait_val_t*)), AIT_GET_I32(array(arr, 2, ait_val_t*))); rpc_cli_freeCall(&arr); - if (argc > 1) + printf("shutdown rpc server? (y/n): "); + if (getchar() == 'y') rpc_cli_execCall(cli, RPC_NOREPLY, CALL_SRVSHUTDOWN, NULL, NULL); rpc_cli_closeBLOBClient(&cli2);