mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 05:47:14 +02:00
exceptions TCP (#31)
* WIP * first test * format * test frames * also 0: * WIP * WIP * first test * format * test frames * also 0: * test and less local * pass ret by value * level * WIP * WIP * cleaning up interface * removed ref * another * updated api version * cleanup * cleanup * WIP * fixes * fixed tests
This commit is contained in:

committed by
Dhanya Thattil

parent
a6144f658e
commit
1db7521cfa
@ -52,26 +52,4 @@ ServerInterface2 ServerSocket::accept() {
|
||||
return ServerInterface2(newSocket);
|
||||
}
|
||||
|
||||
|
||||
int ServerSocket::getPort() const { return serverPort; }
|
||||
|
||||
void ServerSocket::SendResult(int &ret, void* retval, int retvalSize, char* mess) {
|
||||
|
||||
// send success of operation
|
||||
sendData(&ret, sizeof(ret));
|
||||
|
||||
if (ret == slsDetectorDefs::FAIL) {
|
||||
// create error message if empty
|
||||
if (!strlen(mess)) {
|
||||
strcpy(mess, "No error message provided for this failure in server. Will mess up TCP.");
|
||||
}
|
||||
|
||||
sendData(mess, MAX_STR_LENGTH);
|
||||
throw sls::RuntimeError(mess);
|
||||
}
|
||||
// send return value
|
||||
sendData(retval, retvalSize);
|
||||
}
|
||||
|
||||
|
||||
}; // namespace sls
|
||||
|
Reference in New Issue
Block a user