--- libaitrpc/src/cli.c 2012/05/17 15:21:08 1.9.2.11 +++ libaitrpc/src/cli.c 2012/05/17 21:40:02 1.9.2.14 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.9.2.11 2012/05/17 15:21:08 misho Exp $ +* $Id: cli.c,v 1.9.2.14 2012/05/17 21:40:02 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -288,6 +288,13 @@ rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short rpc->call_crc ^= rpc->call_crc; rpc->call_crc = htons(crcFletcher16((u_short*) buf, wlen / 2)); + pfd.fd = cli->cli_sock; + pfd.events = POLLOUT; + if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) == -1 || + pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { + LOGERR; + return -1; + } if ((ret = send(cli->cli_sock, buf, wlen, MSG_NOSIGNAL)) == -1) { LOGERR; return -1;