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:
Erik Fröjdh
2019-06-05 15:25:18 +02:00
committed by Dhanya Thattil
parent a6144f658e
commit 1db7521cfa
14 changed files with 1048 additions and 1752 deletions

View File

@ -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