check online is ok

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@244 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2012-09-10 13:17:09 +00:00
parent ef8455ced6
commit 2cfdc2b108
6 changed files with 11 additions and 25 deletions

View File

@ -1062,32 +1062,13 @@ int slsDetector::setTCPSocket(string const name, int const control_port, int con
#endif
}
if (retval!=FAIL) {
if (controlSocket->Connect()<0) {
controlSocket->SetTimeOut(5);
thisDetector->onlineFlag=OFFLINE_FLAG;
delete controlSocket;
controlSocket=NULL;
retval=FAIL;
#ifdef VERBOSE
std::cout<< "offline!" << std::endl;
#endif
} else {
thisDetector->onlineFlag=ONLINE_FLAG;
controlSocket->SetTimeOut(100);
controlSocket->Disconnect();
#ifdef VERBOSE
std::cout<< "online!" << std::endl;
#endif
}
checkOnline();
} else {
thisDetector->onlineFlag=OFFLINE_FLAG;
#ifdef VERBOSE
std::cout<< "offline!" << std::endl;
#endif
}
return retval;
};