debugging statements

This commit is contained in:
Dhanya Maliakal 2015-05-12 14:28:13 +02:00
parent 15bbb099d3
commit d9809925af
2 changed files with 34 additions and 3 deletions

View File

@ -92,6 +92,13 @@ enum communicationProtocol{
UDP /**< UDP */
};
typedef struct
{
unsigned char header_before[20];
unsigned char fnum[4];
unsigned char header_after[24];
} eiger_image_header;
genericSocket(const char* const host_ip_or_name, unsigned short int const port_number, communicationProtocol p, int ps = DEFAULT_PACKET_SIZE) :
// portno(port_number),
protocol(p),
@ -578,8 +585,33 @@ enum communicationProtocol{
//if length given, listens to length, else listens for packetsize till length is reached
if(length){
/*int k =0;*/
while(length>0){
nsending = (length>packet_size) ? packet_size:length;
/*
//created for debugging on 11.05.2015
nsending=5000;
nsent = recvfrom(socketDescriptor,(char*)buf,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
if(nsent <1000){
if(nsent < 48){
cout << " "<<nsent<<" ";
}else{
cout << "nsent: " << nsent << "\tfnum:" <<
htonl(*(unsigned int*)((eiger_image_header *)((char*)(buf)))->fnum)<< "\t";
cout << k <<" packets" << endl;
k = 0;
}
}
else
k++;
*/
nsent = recvfrom(socketDescriptor,(char*)buf+total_sent,nsending, 0, (struct sockaddr *) &clientAddress, &clientAddress_length);
if(!nsent) break;
length-=nsent;

View File

@ -1950,9 +1950,8 @@ int UDPStandardImplementation::startWriting(){
currframenum = tempframenum;
pthread_mutex_unlock(&progress_mutex);
}
#ifdef VERYDEBUG
if(myDetectorType == EIGER)
cout << endl <<ithread << " tempframenum:" << dec << tempframenum << " curframenum:" << currframenum << endl;
#ifdef EIGER_DEBUG2
cout << endl <<ithread << " tempframenum:" << dec << tempframenum << " curframenum:" << currframenum << endl;
#endif