--- libaitrpc/example/tcli.c 2013/07/16 13:04:20 1.14 +++ libaitrpc/example/tcli.c 2013/08/22 12:01:36 1.14.6.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); @@ -248,7 +250,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);