fix for segfault WIP

This commit is contained in:
2020-04-27 14:00:00 +02:00
parent edbd70e91a
commit 56bc9c4e08
2 changed files with 7 additions and 2 deletions

View File

@ -784,8 +784,12 @@ void Detector::setRxHostname(const int udpInterface, const std::string &hostname
void Detector::setRxHostname(const int udpInterface, const std::string &hostname, const int port,
int module_id) {
if (module_id == -1 && size() > 1) {
if (module_id == -1) {
if (size() > 1) {
throw sls::RuntimeError("Cannot set same rx_tcpport and rx_hostname for multiple receivers");
} else {
module_id = 0;
}
}
pimpl->configureReceiver(udpInterface, module_id, hostname, port);
}

View File

@ -502,6 +502,7 @@ void DetectorImpl::configureReceiver(const int udpInterface, int module_id,
if (!isReceiverInitialized(udpInterface)) {
initReceiver(udpInterface);
}
std::cout << "module_id:"<<module_id << std::endl;
auto t = detectors[module_id]->getReceiverParameters();
if (udpInterface == 1) {
receivers[module_id][0]->setTCPPort(port);