From 2bee95aee3de592255281aa2189bb3b30a4d8c1e Mon Sep 17 00:00:00 2001 From: buret Date: Tue, 19 Jun 2007 08:31:05 +0000 Subject: - Replace parameter pointers by references - Create a parameter object and replace char* by string - Bug correction after confrontation tests git-svn-id: svn+ssh://pessac/svn/cesar/trunk@320 017c9cb6-072f-447c-8318-d5b54f68fe89 --- maximus/sci/src/SciServer.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'maximus/sci/src') diff --git a/maximus/sci/src/SciServer.cpp b/maximus/sci/src/SciServer.cpp index 1d1cd51fd3..5d0a6fdbce 100644 --- a/maximus/sci/src/SciServer.cpp +++ b/maximus/sci/src/SciServer.cpp @@ -84,9 +84,11 @@ void SciServer::initAttributes ( ) pthread_mutex_init(&mServerMutex, NULL); // start the server thread - mStatus = (Sci_Server_Status)pthread_create(&mServerThread, NULL, SciServer::serverThread, this); - if(mStatus != 0) + setStatus ((Sci_Server_Status)pthread_create(&mServerThread, NULL, SciServer::serverThread, this)); + if(0 != getStatus()) throw new Error(__FUNCTION__, "pthread_create", errno); + else + setStatus (MAXIMUS_SCI_SERVER_STATUS_RUNNING); } @@ -351,6 +353,7 @@ void * SciServer::serverThread ( void * arg ) while(sci_server->getStatus() == MAXIMUS_SCI_SERVER_STATUS_RUNNING) { + //cout << "status running" << endl; // timeout set to 1sec timeout.tv_sec = 1; timeout.tv_usec = 0; @@ -382,7 +385,7 @@ void * SciServer::serverThread ( void * arg ) header_len = sizeof(struct Sci_Msg_Header); if((len = read(fd_index, &header, sizeof(struct Sci_Msg_Header))) < header_len) { - clog << "\theader read error: len=" << len << ", errno=" << errno << endl; + //clog << "\theader read error: len=" << len << ", errno=" << errno << endl; continue; } else @@ -603,9 +606,9 @@ bool SciServer::setStatus ( const Sci_Server_Status new_status ) throw (Error) else { mStatus = new_status; - //clog << "\tstatus = "; - //displayStatus(); - //clog << endl; + clog << "\tstatus = "; + displayStatus(); + clog << endl; bSetStatus = true; } @@ -623,6 +626,7 @@ bool SciServer::setStationsList ( StationsList * stations_list ) { //clog << "SciServer::setStationsList" << endl; bool bSetList = false; + StationsList::iterator it; if (NULL != stations_list) { -- cgit v1.2.3