mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 11:20:04 +02:00
slsDetector: connect stop socket in checkonline so that it does not stick to its initialized default file descriptor zero (which gets closed upon socket deletion)
This commit is contained in:
parent
05055eb283
commit
147194e8af
@ -1,5 +1,5 @@
|
|||||||
PKGDIR = ../..
|
PKGDIR = ../..
|
||||||
LIBDIR = $(PKGDIR)/bin
|
LIBDIR = $(PKGDIR)/build/bin
|
||||||
INCLUDES = -I . -I$(PKGDIR)/slsReceiverSoftware/include -I$(PKGDIR)/slsDetectorSoftware/slsDetectorAnalysis -I$(LIBDIR) -I$(PKGDIR)/slsDetectorSoftware/slsDetector
|
INCLUDES = -I . -I$(PKGDIR)/slsReceiverSoftware/include -I$(PKGDIR)/slsDetectorSoftware/slsDetectorAnalysis -I$(LIBDIR) -I$(PKGDIR)/slsDetectorSoftware/slsDetector
|
||||||
SRC_DET = mainClient.cpp
|
SRC_DET = mainClient.cpp
|
||||||
SRC_REC = mainReceiver.cpp
|
SRC_REC = mainReceiver.cpp
|
||||||
|
@ -1756,6 +1756,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, stopSocket=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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user