refactor receiver client interface, moved defs into one sls_detector_defs.h

This commit is contained in:
2018-10-11 12:25:18 +02:00
parent d0950ba001
commit 5a356534e6
56 changed files with 1155 additions and 2386 deletions

View File

@ -30,8 +30,24 @@ int ClientInterface::PrintSocketReadError() {
}
void ClientInterface::Server_SendResult(int ret, void* retval, int retvalSize) {
void ClientInterface::Server_SendResult(bool diffClients, int ret,
void* retval, int retvalSize, char* mess) {
// update if different clients
if (diffClients)
ret = FORCE_UPDATE;
// send success of operation
mySocket->SendDataOnly(&ret,sizeof(ret));
if(ret == FAIL) {
// send error message
if (mess)
mySocket->SendDataOnly(mess, MAX_STR_LENGTH);
// debugging feature. should not happen.
else
FILE_LOG(logERROR) << "No error message provided for this failure. Will mess up TCP\n";
}
// send return value
mySocket->SendDataOnly(retval, retvalSize);
}