mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 06:50:02 +02:00
client: rx_tcpport fixed
This commit is contained in:
parent
43ad8b69b3
commit
c218e391bb
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user