Hi,
I programmed an application that should receive UDP packets (size 38000) and in a first step just send it to the next PC.
The packets come fast and at first i had a problem getting the packets out as fast as they came. This seems solved though by using four sockets to send the data out.
Now it looks like the recv returns with the right size of the received message (38000) but either the data is scrambled or the buffer is incomplete...
Here is a sniplet of the receiving code.
Any ideas what could be wrong here?Code:recvdLen = recv(dlg->udpRecvSocket, dlg->receiveBuffer1.buffer, maxLen, 0); if (recvdLen != 0 && recvdLen != SOCKET_ERROR) { dlg->logFile << "Recv1 " << recvdLen << endl; dlg->logFile.flush(); dlg->receiveBuffer1.length = recvdLen; AfxBeginThread(UdpSenderProcedure1,dlg); } else if (recvdLen == SOCKET_ERROR) { dlg->logFile << "socket_error on receive1: " << (int)GetLastError(); } else { return 1; }
Thanks!





Reply With Quote