--- projects/cms/source/host/c++/Host.cpp 2001/03/05 12:40:32 1.2 +++ projects/cms/source/host/c++/Host.cpp 2001/03/06 00:40:28 1.3 @@ -76,12 +76,12 @@ int main(){ std::cout << "Starting Data Collection\n"; // work out which is closer, the next heartbeat or the next data collection - long localTime = time(NULL); + int localTime = time(NULL); // std::cout << "#"; int nextUDPTime = localTime + UDPUpdateTime; int nextAveragerTime = localTime + AveragerUpdateTime; int nextTCPTime = localTime + TCPUpdateTime; - long sequence = 0; + int sequence = 0; int nextAction = 0; while ( noErrors == 1){ @@ -127,10 +127,12 @@ int main(){ } // if MaxFilterRetrys = 5; } // if - + // reloadConfig is done now + reloadConfig = 0; } // if reloadconfig + localTime = time(NULL); // std::cout << "."; // keep going while no non-fatal errors have occurred @@ -164,8 +166,6 @@ int main(){ // sleep until this time only if it is greater than 1! if ( waitTime >= 1 ){ - // need to output \n to std::cout or the wait is infinate!!!! ????? - // will core dump if debug = 0 sleep(waitTime); /// crashes here } @@ -213,20 +213,21 @@ int main(){ string host = (config.getSmallNet())->getHostName(); string ip = (config.getSmallNet())->getHostIP(); - char * buffer; - buffer = l64a( sequence ); - char * seq = buffer; - buffer = l64a( localTime ); - char * date = buffer; - - - string attributes = "type=\"data\" machine_name=\""+host+"\" ip=\""+ip+"\" date=\""+date+"\" seq_no=\""+seq+"\""; + string seq = ""; + // char * buffer; + char buffer[32]; + sprintf(buffer,"%u", sequence); + seq = buffer; + string date = ""; + sprintf(buffer,"%u", localTime); + date = buffer; + string attributes = "type=\"data\" machine_name=\""+host+"\" ip=\""+ip+"\" date=\""+date+"\" seq_no=\""+seq+"\""; XMLFormatter xml("packet",attributes); // put in the data xml.addString(sysMon.getData()); (config.getSmallNet())->sendUPDPacket(config.getUDPFilterName(), config.getUDPFilterPort(), xml.returnXML()); - + sequence++; break; } // switch @@ -240,4 +241,4 @@ int main(){ return 0; -} // main \ No newline at end of file +} // main