This commit is contained in:
Dhanya Maliakal 2016-10-31 14:45:19 +01:00
parent 89928246d2
commit 351d911f46
2 changed files with 4 additions and 1 deletions

View File

@ -620,6 +620,7 @@ enum communicationProtocol{
else
nsending = (length>packet_size) ? packet_size:length; //works for eiger to get packets to discard image header packets
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
cout<<"nsent:"<<nsent<<endl;
if(nsent != nsending){ //if((nsent != nsending)){ && (nsent < packet_size)){
if(nsent && (nsent != header_packet_size) && (nsent != -1))
cprintf(RED,"Incomplete Packet size %d\n",nsent);

View File

@ -2118,15 +2118,17 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
(*((uint32_t*)(buffer[ithread]+8))) = (*( (uint32_t*) header->frameNumber))&frameIndexMask;
cout<<"current fnum:"<<(*((uint32_t*)(buffer[ithread]+8)))<<endl;
}
//get data
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, oneDataSize);
if(!receivedSize) return 0;
cout<<"got data for " << pnum << endl;
offset+=oneDataSize;
cout<<"offset now at:" << offset << endl;
//got a complete frame
if(pnum == 0)
break;
pnum --;
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + offset, JFRAU_HEADER_LENGTH);
if(!receivedSize) return 0;
header = (jfrau_packet_header_t*)(buffer[ithread] + offset);