--- libaitrpc/example/tcli.c 2011/08/19 09:20:46 1.2.4.1 +++ libaitrpc/example/tcli.c 2011/08/19 13:41:17 1.2.4.5 @@ -3,8 +3,8 @@ #include //rpc_val_t valz[3]; -#define sTYPE SOCK_STREAM + int main() { rpc_cli_t *cli, *cli2; @@ -12,12 +12,13 @@ int main() rpc_val_t tval, valz[3], *v = NULL; char *mem, *blob43 = malloc(512); - cli = rpc_cli_openClient(100, 2, sTYPE, 2, "127.0.0.1", 11111); + cli = rpc_cli_openClient(100, 2, AF_INET, "127.0.0.1", 11111); +// cli = rpc_cli_openClient(100, 2, AF_LOCAL, "0.0.0.0", 11111); if (!cli) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); return 1; } - cli2 = rpc_cli_openBLOBClient(cli, sTYPE, 0); + cli2 = rpc_cli_openBLOBClient(cli, 0); if (!cli2) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); return 1; @@ -56,9 +57,10 @@ int main() printf("ret_val2:: is_empty? %d %s len=%d type=%d\n", RPC_EMPTY_VAL(&v[2]), RPC_GET_STR(&v[2]), RPC_LEN_VAL(&v[2]), RPC_TYPE_VAL(&v[2])); printf("ret_val3:: %X %d\n", RPC_GET_BLOB(&v[3]), RPC_LEN_VAL(&v[3])); - printf("test found blob=%d\n", rpc_cli_getBLOB(cli2, &v[3], (void**) &mem)); +// printf("test found blob=%d\n", rpc_cli_getBLOB(cli2, &v[3], (void**) &mem)); + printf("+++++++++ test found blob=%d\n", rpc_cli_recvBLOB(cli2, &v[3], (void**) &mem)); if (mem) { - printf("BLOB=%s", mem); + printf("+++++++ BLOB=%s", mem); free(mem); } RPC_FREE_VAL(&v[0]);