mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-15 06:17:12 +02:00
slsDetectorSoftware: connect stop socket as well to confirm detector on line, also to prevent fclose closing socket 0 (if it never connected to stop socket). Future releases can use exception instead of using socketDescriptor 0 value to validate succesful constructor
This commit is contained in:
@ -1321,6 +1321,26 @@ string slsDetector::checkOnline() {
|
|||||||
disconnectControl();
|
disconnectControl();
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "online!" << std::endl;
|
std::cout<< "online!" << std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//still cannot connect to socket, controlSocket=0
|
||||||
|
if(stopSocket){
|
||||||
|
if (connectStop() == FAIL) {
|
||||||
|
stopSocket->SetTimeOut(5);
|
||||||
|
thisDetector->onlineFlag=OFFLINE_FLAG;
|
||||||
|
delete stopSocket;
|
||||||
|
stopSocket=NULL;
|
||||||
|
retval = string(thisDetector->hostname);
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout<< "stop offline!" << std::endl;
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
thisDetector->onlineFlag=ONLINE_FLAG;
|
||||||
|
stopSocket->SetTimeOut(100);
|
||||||
|
disconnectStop();
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout<< "stop online!" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user