From 5dd5c250f3c30593706dd67f3ed8c80a6440443d Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Wed, 19 Aug 2015 14:55:15 +0200 Subject: [PATCH] removing unnecessary prints --- slsReceiverSoftware/include/genericSocket.h | 30 +++---------------- .../src/UDPBaseImplementation.cpp | 2 -- .../src/UDPStandardImplementation.cpp | 19 ++++++------ 3 files changed, 13 insertions(+), 38 deletions(-) diff --git a/slsReceiverSoftware/include/genericSocket.h b/slsReceiverSoftware/include/genericSocket.h index 3bb4adcff..aa79f3233 100644 --- a/slsReceiverSoftware/include/genericSocket.h +++ b/slsReceiverSoftware/include/genericSocket.h @@ -60,7 +60,6 @@ class sockaddr_in; #include #endif -#include "ansi.h" #include /******exit */ #include @@ -71,7 +70,6 @@ class sockaddr_in; #include #include -#include //SIGINT using namespace std; @@ -127,7 +125,6 @@ typedef struct struct hostent *hostInfo = gethostbyname(host_ip_or_name); if (hostInfo == NULL){ cerr << "Exiting: Problem interpreting host: " << host_ip_or_name << "\n"; - cprintf(RED,"Exiting: Problem interpreting host:%s\n",host_ip_or_name); } else { // Set some fields in the serverAddress structure. serverAddress.sin_family = hostInfo->h_addrtype; @@ -137,7 +134,6 @@ typedef struct socketDescriptor=0; //You can use send and recv, //would it work????? } clientAddress_length=sizeof(clientAddress); - cprintf(MAGENTA, "client socket created %d \n",socketDescriptor,protocol); } @@ -180,7 +176,6 @@ typedef struct nsent(0), total_sent(0) { - signal(SIGCHLD,SIG_IGN); //memset(&serverAddress, 0, sizeof(sockaddr_in)); // memset(&clientAddress, 0, sizeof(sockaddr_in)); // serverAddress = {0}; @@ -210,12 +205,10 @@ typedef struct socketDescriptor = socket(AF_INET, getProtocol(),0); //tcp - cprintf(MAGENTA, "socket created %d protocol:%d\n",socketDescriptor,protocol); if (socketDescriptor < 0) { cerr << "Can not create socket "<0) { if ((file_des = accept(socketDescriptor,(struct sockaddr *) &clientAddress, &clientAddress_length)) < 0) { cerr << "Error: with server accept, connection refused"<=0){ @@ -459,16 +443,10 @@ typedef struct if(file_des>=0){ //then was open if(is_a_server){ - // cprintf(MAGENTA, "file_des disconnected %d \n",file_des); - if(close(file_des)) - cprintf(RED,"file_des not disconnected %d\n", file_des); - // cprintf(MAGENTA, "file_des disconnected %d \n",file_des); + close(file_des); } else { - //cprintf(MAGENTA, "socketDescriptor disconnected %d \n",socketDescriptor); - if(close(socketDescriptor)) - cprintf(RED,"socketDescriptor not disconnected %d\n", file_des); - // cprintf(MAGENTA, "socketDescriptor disconnected %d \n",socketDescriptor); + close(socketDescriptor); socketDescriptor=-1; } file_des=-1; diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index 80ce6b2c7..670805a46 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -746,7 +746,6 @@ int UDPBaseImplementation::createUDPSockets(){ FILE_LOG(logDEBUG) << __AT__ << " cout<<"warning:eth is empty.listening to all"<getErrorStatus(); if(!iret){ cout << "UDP port opened at port " << port[i] << endl; - cprintf(YELLOW, "socket of port %d descriptor:%d\n",i,udpSocket[i]->getsocketDescriptor()); + //cprintf(YELLOW, "socket of port %d descriptor:%d\n",i,udpSocket[i]->getsocketDescriptor()); }else{ #ifdef VERBOSE cprintf(BG_RED,"Could not create UDP socket on port %d error: %d\n", port[i], iret); @@ -1411,7 +1411,7 @@ int UDPStandardImplementation::createNewFile(){ //close if(sfilefd){ if(fclose(sfilefd)){ - cprintf(YELLOW, "file clsoe problem %d\n",fileno(sfilefd)); + cprintf(RED, "file close problem %d\n",fileno(sfilefd)); fclose(sfilefd); } sfilefd = NULL; @@ -1430,9 +1430,8 @@ int UDPStandardImplementation::createNewFile(){ //setting buffer setvbuf(sfilefd,NULL,_IOFBF,BUF_SIZE); - cprintf(YELLOW, "file value:%d\n",fileno(sfilefd)); + //cprintf(YELLOW, "file value:%d\n",fileno(sfilefd)); - //cprintf(YELLOW, "file valuex:%d",(int)sfilefd); //printing packet losses and file names if(!packetsCaught) cout << savefilename << endl; @@ -1474,12 +1473,12 @@ void UDPStandardImplementation::closeFile(int ithr){ if(!dataCompression){ if(sfilefd){ -//#ifdef VERBOSE +#ifdef VERBOSE cprintf(YELLOW, "gonna close file:%d\n",fileno(sfilefd)); -//#endif +#endif if(fclose(sfilefd)) - perror("close ERRROR"); - cprintf(YELLOW, "check close file:%d\n",fileno(sfilefd)); + perror("file close ERROR"); + //cprintf(YELLOW, "check close file:%d\n",fileno(sfilefd)); sfilefd = NULL; } }