--- libaitrpc/example/tcli.c 2011/08/31 17:11:57 1.3.2.3 +++ libaitrpc/example/tcli.c 2011/09/03 12:39:27 1.3.2.7 @@ -19,6 +19,7 @@ int main() printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); return 1; } + cli2 = rpc_cli_openBLOBClient(cli, 0); if (!cli2) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); @@ -28,18 +29,18 @@ int main() memset(blob43, 0, 512); strlcpy(blob43, "aaaaaaaaaaaaaaa cddddddddddddddd zzzzzzzzzzzzzzzzzzzzz !!!!\n\n\n675675676...\n", 512); - valz = rpc_cli_allocVals(3); + valz = rpc_cli_allocVals(2); v = io_array(valz, 0, ait_val_t*); AIT_SET_I32(v, 12345678); v = io_array(valz, 1, ait_val_t*); AIT_SET_STR(v, "gniah_blah SHMINK!"); - v = io_array(valz, 2, ait_val_t*); - AIT_SET_BLOB(v, 0, 512); - if (rpc_cli_sendBLOB(cli2, v, blob43) == -1) { - printf("!!!!! blob error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); - return 2; - } else - printf("Get BLOB = %x\n", AIT_GET_BLOB(v)); +// v = io_array(valz, 2, ait_val_t*); +// AIT_NEW_BLOB(v, 512); +// if (rpc_cli_sendBLOB(cli2, v, blob43) == -1) { +// printf("!!!!! blob error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); +// return 2; +// } else +// printf("Get BLOB = %x\n", AIT_GET_BLOB(v)); /* test case for unknown blob ... AIT_SET_BLOB(&tval, 0x554C1BC7, BUFSIZ); @@ -64,14 +65,14 @@ int main() v = io_array(arr, 2, ait_val_t*); printf("ret_val2:: is_empty? %d %s len=%d type=%d\n", AIT_ISEMPTY(v), AIT_GET_STR(v), AIT_LEN(v), AIT_TYPE(v)); - v = io_array(arr, 3, ait_val_t*); - printf("ret_val3:: %X %d\n", AIT_GET_BLOB(v), AIT_LEN(v)); -// 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, (void**) &mem)); - if (mem) { - printf("+++++++ BLOB=%s", mem); - free(mem); - } +// v = io_array(arr, 3, ait_val_t*); +// printf("ret_val3:: %X %d\n", AIT_GET_BLOB(v), AIT_LEN(v)); +// printf("test found blob=%d\n", rpc_cli_getBLOB(cli2, v, (void**) &mem)); +//// printf("+++++++++ test found blob=%d\n", rpc_cli_recvBLOB(cli2, v, (void**) &mem)); +// if (mem) { +// printf("+++++++ BLOB=%s", mem); +// free(mem); +// } rpc_cli_freeVals(&arr); } } @@ -92,6 +93,7 @@ int main() for (i = 0; i < (arr ? io_arraySize(arr) : 0); i++) printf("registeredClient(%d)=%s\n", i, AIT_GET_STR(io_array(arr, i, ait_val_t*))); rpc_cli_freeVals(&arr); + /* if (rpc_cli_execCall(cli, NULL, CALL_BLOBCLIENTS, NULL, &arr) < 0) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); return 4; @@ -106,8 +108,9 @@ int main() return 5; } for (i = 0; i < (arr ? io_arraySize(arr) : 0); i++) - printf("registeredBLOBVars(%d)=%0X\n", i, AIT_GET_U32(io_array(arr, i, ait_val_t*))); + printf("registeredBLOBVars(%d)=%s\n", i, AIT_GET_STR(io_array(arr, i, ait_val_t*))); rpc_cli_freeVals(&arr); + */ if (rpc_cli_execCall(cli, NULL, CALL_SRVCALLS, NULL, &arr) < 0) { printf("error:: errno=%d %s\n", rpc_GetErrno(), rpc_GetError()); return 5;