if (fcntl (i4SockDesc, F_SETFL, O_NONBLOCK) < 0)
{
printf(LDP_IF_MISC, "LDPTCP: Client : Can't Set Sckt in NON BLK\n");
return CONNECT_FAIL;
}
i4RetVal = send (i4SockDesc, (UINT1 *) pu1Data, u2BufLen, MSG_NOSIGNAL);
if (i4RetVal != u2BufLen)
{
perror("Socket send failure!!\n");
printf(i4SockDesc = %d, u2BufLen = %d, i4RetVal = %d\n", i4SockDesc, u2BufLen, i4RetVal);
printf("Socket send Failure: %s, errno = %d\n",strerror(errno), errno);
}
send() 调用失败,错误为“没有这样的文件或目录”errno = 2。
i4SockDesc = 90, u2BufLen = 100, i4RetVal = -1
Socket send Failure: No such file or directory, errno = 2