mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
Minimal shared memory for receiver
This commit is contained in:
@ -70,7 +70,19 @@ int ClientSocket::sendCommandThenRead(int fnum, const void *args,
|
||||
|
||||
void ClientSocket::readReply(int &ret, void *retval, size_t retval_size) {
|
||||
|
||||
Receive(&ret, sizeof(ret));
|
||||
try {
|
||||
Receive(&ret, sizeof(ret));
|
||||
}
|
||||
// debugging
|
||||
catch (sls::SocketError &e) {
|
||||
if (socketType == "Receiver") {
|
||||
throw ReceiverError("Receiver returned: " + std::string(e.what()));
|
||||
} else if (socketType == "Detector") {
|
||||
throw DetectorError("Detector returned: " + std::string(e.what()));
|
||||
} else {
|
||||
throw GuiError(e.what());
|
||||
}
|
||||
}
|
||||
if (ret == slsDetectorDefs::FAIL) {
|
||||
char mess[MAX_STR_LENGTH]{};
|
||||
// get error message
|
||||
|
@ -85,7 +85,7 @@ IpAddr HostnameToIp(const char *hostname) {
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
if (getaddrinfo(hostname, nullptr, &hints, &result)) {
|
||||
freeaddrinfo(result);
|
||||
throw RuntimeError("Could not convert hostname to ip");
|
||||
throw RuntimeError("Could not convert hostname (" + std::string(hostname) + ") to ip");
|
||||
}
|
||||
uint32_t ip = ((sockaddr_in *)result->ai_addr)->sin_addr.s_addr;
|
||||
freeaddrinfo(result);
|
||||
|
Reference in New Issue
Block a user