请问我程序一执行到这就出问题WSARecvFrom(SerSocket,&buffer,1,&rel,&Flag,(SOCKADDR*)&recvaddr,&socklen,NULL,NULL);错误代码为10040(Message too long ).请问这是怎么回事啊?是我buffer定义的不对吗?char *in;in=new char[RecvLen-temp];buffer.buf=in;buffer.len=(RecvLen-temp);

解决方案 »

  1.   

    10040 WSAEMSGSIZE
     The message was too large for the specified buffer and (for unreliable protocols only) any trailing portion of the message that did not fit into the buffer has been discarded.意思是说对方传送过来的消息报文远大于你WSARecvFrom提交的接收缓冲区,所以你应该重新定义更大的缓冲区用于接收报文.
     
      

  2.   

    你有用过speex的编解码吗?为什么这个解压函数speex_decode(state, &bits,(float*)(MyNetWav->OutAdio[MyNetWav->nRecv].lpData+temp) )第一次调用时没问题,第二次调用时就出现问题了呢?Access Violation!
      

  3.   

    那你应该把重心放在Access Violation!的查处.