client: rx_tcpport fixed

This commit is contained in:
maliakal_d 2019-02-25 11:43:10 +01:00
parent 43ad8b69b3
commit c218e391bb

View File

@ -906,34 +906,30 @@ int slsDetector::setStopPort(int port_number) {
} }
int slsDetector::setReceiverPort(int port_number) { int slsDetector::setReceiverPort(int port_number) {
int fnum = F_SET_PORT; int fnum = F_SET_RECEIVER_PORT;
int ret = FAIL; int ret = FAIL;
int retval = -1; int retval = -1;
if (port_number > 0)
thisDetector->receiverTCPPort = port_number;
//TODO! How do I update the receiver port?
// FILE_LOG(logDEBUG1) << "Setting receiver port "
// << " to " << port_number;
// // same port FILE_LOG(logDEBUG1) << "Setting reciever port "
// if (port_number == thisDetector->receiverTCPPort) { << " to " << port_number;
// return thisDetector->receiverTCPPort;
// }
// // set port if (port_number >= 0 && port_number != thisDetector->receiverTCPPort) {
// if (thisDetector->receiverOnlineFlag == ONLINE_FLAG) { if (thisDetector->receiverOnlineFlag == ONLINE_FLAG) {
// auto receiver = sls::ClientSocket(true, thisDetector->receiver_hostname, thisDetector->receiverTCPPort); auto stop = sls::ClientSocket(true, thisDetector->receiver_hostname, thisDetector->receiverTCPPort);
// ret = receiver.sendCommandThenRead(fnum, &port_number, sizeof(port_number), &retval, sizeof(retval)); ret = stop.sendCommandThenRead(fnum, &port_number, sizeof(port_number), &retval, sizeof(retval));
// if (ret == FAIL) { if (ret == FAIL) {
// setErrorMask((getErrorMask()) | (COULDNOT_SET_DATA_PORT)); setErrorMask((getErrorMask()) | (COULDNOT_SET_DATA_PORT));
// } else { } else {
// thisDetector->receiverTCPPort = retval; thisDetector->receiverTCPPort = retval;
// FILE_LOG(logDEBUG1) << "Receiver port: " << retval; FILE_LOG(logDEBUG1) << "Receiver port: " << retval;
// } }
// } if (ret == FORCE_UPDATE) {
// if (ret == FORCE_UPDATE) { ret = updateReceiver();
// ret = updateReceiver(); }
// } } else {
thisDetector->receiverTCPPort = port_number;
}
}
return thisDetector->receiverTCPPort; return thisDetector->receiverTCPPort;
} }