mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 07:20:01 +02:00
28 lines
735 B
C++
28 lines
735 B
C++
// SPDX-License-Identifier: LGPL-3.0-or-other
|
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
|
#include "sls/ServerInterface.h"
|
|
#include "sls/logger.h"
|
|
#include <cassert>
|
|
#include <cstring>
|
|
#include <sstream>
|
|
namespace sls {
|
|
|
|
int ServerInterface::sendResult(int ret, void *retval, int retvalSize,
|
|
char *mess) {
|
|
|
|
write(&ret, sizeof(ret));
|
|
if (ret == defs::FAIL) {
|
|
if (mess != nullptr) {
|
|
write(mess, MAX_STR_LENGTH);
|
|
} else {
|
|
LOG(logERROR) << "No error message provided for this "
|
|
"failure. Will mess up TCP\n";
|
|
}
|
|
} else {
|
|
write(retval, retvalSize);
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
} // namespace sls
|