initializing variables and copying ot gui only full frames

This commit is contained in:
Dhanya Maliakal
2015-02-10 12:21:31 +01:00
parent e975a75be9
commit bea1791b4d
2 changed files with 9 additions and 2 deletions

View File

@ -103,6 +103,10 @@ enum communicationProtocol{
nsent(0), nsent(0),
total_sent(0)// sender (client): where to? ip total_sent(0)// sender (client): where to? ip
{ {
memset(&serverAddress, 0, sizeof(sockaddr_in));
memset(&clientAddress, 0, sizeof(sockaddr_in));
// serverAddress = {0};
// clientAddress = {0};
// strcpy(hostname,host_ip_or_name); // strcpy(hostname,host_ip_or_name);
struct hostent *hostInfo = gethostbyname(host_ip_or_name); struct hostent *hostInfo = gethostbyname(host_ip_or_name);
if (hostInfo == NULL){ if (hostInfo == NULL){
@ -158,7 +162,10 @@ enum communicationProtocol{
nsent(0), nsent(0),
total_sent(0) total_sent(0)
{ {
memset(&serverAddress, 0, sizeof(sockaddr_in));
memset(&clientAddress, 0, sizeof(sockaddr_in));
// serverAddress = {0};
// clientAddress = {0};
/* // you can specify an IP address: */ /* // you can specify an IP address: */
/* */ /* */

View File

@ -1890,7 +1890,7 @@ int UDPStandardImplementation::startWriting(){
} }
else{ else{
//copy to gui //copy to gui
if((packetsPerFrame * numpackets) == bufferSize){ if(numpackets == packetsPerFrame * numJobsPerThread){ //only full frames
copyFrameToGui(NULL,-1,wbuf[0]+HEADER_SIZE_NUM_TOT_PACKETS); copyFrameToGui(NULL,-1,wbuf[0]+HEADER_SIZE_NUM_TOT_PACKETS);
#ifdef VERYVERBOSE #ifdef VERYVERBOSE
cout << ithread << " finished copying" << endl; cout << ithread << " finished copying" << endl;