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

@ -70,11 +70,11 @@ int ClientSocket::sendCommandThenRead(int fnum, const void *args,
void ClientSocket::readReply(int &ret, void *retval, size_t retval_size) {
receiveData(&ret, sizeof(ret));
read(&ret, sizeof(ret));
if (ret == slsDetectorDefs::FAIL) {
char mess[MAX_STR_LENGTH]{};
// get error message
receiveData(mess, sizeof(mess));
read(mess, sizeof(mess));
FILE_LOG(logERROR) << socketType << " returned error: " << mess;
std::cout << "\n"; // needed to reset the color.
@ -89,7 +89,7 @@ void ClientSocket::readReply(int &ret, void *retval, size_t retval_size) {
}
}
// get retval
receiveData(retval, retval_size);
read(retval, retval_size);
}
}; // namespace sls