C++ 套接字编程中非法搜索的可能原因

C++ 套接字编程中非法搜索的可能原因,c++,c,sockets,C++,C,Sockets,我在发送数据时收到以下错误 发送:29非法搜索 请解释可能的原因。我不熟悉套接字编程。提前谢谢 CHAR datasend[200]; DOUBLE64 fTime=0.0; LONG32 sent_bytes=0; while(TRUE) { memset(datasend,0,200); fTime=getTime(); sprintf(datasend,"0=%.0lf ",fTime)

我在发送数据时收到以下错误

发送:29非法搜索

请解释可能的原因。我不熟悉套接字编程。提前谢谢

CHAR datasend[200];
    DOUBLE64 fTime=0.0;
    LONG32 sent_bytes=0;
    while(TRUE)
    {
            memset(datasend,0,200);
            fTime=getTime();
            sprintf(datasend,"0=%.0lf ",fTime);
            sent_bytes = send ( isockfd, datasend, strlen(datasend),0);
            logDebug1("Pulse is %s and data bytes is %d",datasend,strlen(datasend));
            if(sent_bytes <= 0)
            {
                    logPError("send");
                    logTimestamp("Closing socket\n");
                    close(isockfd);
                    return NULL;
            }

            sleep(25);

    }
由于中间的logDebug1调用,您没有解释正确的错误


你收到了一封邮件,它返回了一些你忘记发布相关源代码的东西。我已经编辑并添加了源代码code@user1095108:请你把logDebug1移走,检查一下好吗again@user2531564没关系,您对errno的解释是错误的。logDebug1和logPError以及logTimestamp是使用printf和perror函数打印数据的函数。。我对更广泛的情况提出的问题是,出现非法搜索错误的可能原因是什么。@user2531564:如果你不思考他写的内容,我们怎么知道你是否理解其中的一个词?@user2531564“更广泛的情况”是你没有从套接字操作中得到“非法搜索”错误。您得到了一个目前未知的错误,在获取和打印它之间,您通过执行其他操作破坏了该错误。一定要注意。