--- libaitrpc/src/blob.c 2011/05/02 23:12:08 1.2 +++ libaitrpc/src/blob.c 2011/08/19 09:32:38 1.2.4.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: blob.c,v 1.2 2011/05/02 23:12:08 misho Exp $ +* $Id: blob.c,v 1.2.4.1 2011/08/19 09:32:38 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -216,7 +216,7 @@ rpc_srv_sendBLOB(rpc_cli_t * __restrict cli, rpc_blob_ } for (ret = blob->blob_len, pos = blob->blob_data; ret > 0; ret -= len, pos += len) - if ((len = send(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret, 0)) == -1) { + if ((len = write(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret)) == -1) { LOGERR; return -1; } @@ -252,7 +252,7 @@ rpc_srv_recvBLOB(rpc_cli_t * __restrict cli, rpc_blob_ return -1; } - if ((len = recv(cli->cli_sock, pos, BLOBSIZ, 0)) == -1) { + if ((len = read(cli->cli_sock, pos, BLOBSIZ)) == -1) { LOGERR; return -1; } @@ -289,13 +289,13 @@ rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, rpc_val_t hdr.hdr_var = 0; hdr.hdr_ret = 0; hdr.hdr_len = var->val_len; - if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { + if (write(cli->cli_sock, &hdr, sizeof hdr) == -1) { LOGERR; return -1; } for (ret = var->val_len, pos = data; ret > 0; ret -= len, pos += len) - if ((len = send(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret, 0)) == -1) { + if ((len = write(cli->cli_sock, pos, ret > BLOBSIZ ? BLOBSIZ : ret)) == -1) { LOGERR; return -1; } @@ -310,7 +310,7 @@ rpc_cli_sendBLOB(rpc_cli_t * __restrict cli, rpc_val_t rpc_SetErr(ETIMEDOUT, "Error:: Timeout reached! Server not responde ...\n"); return -1; } - if (recv(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { + if (read(cli->cli_sock, &hdr, sizeof hdr) == -1) { LOGERR; return -1; } @@ -359,7 +359,7 @@ rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t hdr.hdr_var = (uint32_t) RPC_GET_BLOB(var); hdr.hdr_ret = 0; hdr.hdr_len = 0; - if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { + if (write(cli->cli_sock, &hdr, sizeof hdr) == -1) { LOGERR; free(*data); *data = NULL; @@ -377,7 +377,7 @@ rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t return -1; } - if ((len = recv(cli->cli_sock, pos, BLOBSIZ, 0)) == -1) { + if ((len = read(cli->cli_sock, pos, BLOBSIZ)) == -1) { LOGERR; free(*data); *data = NULL; @@ -399,7 +399,7 @@ rpc_cli_recvBLOB(rpc_cli_t * __restrict cli, rpc_val_t *data = NULL; return -1; } - if (recv(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { + if (read(cli->cli_sock, &hdr, sizeof hdr) == -1) { LOGERR; free(*data); *data = NULL; @@ -440,7 +440,7 @@ rpc_cli_delBLOB(rpc_cli_t * __restrict cli, rpc_val_t hdr.hdr_var = (uint32_t) RPC_GET_BLOB(var); hdr.hdr_ret = 0; hdr.hdr_len = 0; - if (send(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { + if (write(cli->cli_sock, &hdr, sizeof hdr) == -1) { LOGERR; return -1; } @@ -455,7 +455,7 @@ rpc_cli_delBLOB(rpc_cli_t * __restrict cli, rpc_val_t rpc_SetErr(ETIMEDOUT, "Error:: Timeout reached! Server not responde ...\n"); return -1; } - if (recv(cli->cli_sock, &hdr, sizeof hdr, 0) == -1) { + if (read(cli->cli_sock, &hdr, sizeof hdr) == -1) { LOGERR; return -1; }