mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
client: must print detector or receiver returning error
This commit is contained in:
@ -9,12 +9,13 @@ namespace sls {
|
||||
|
||||
class ClientSocket : public DataSocket {
|
||||
public:
|
||||
ClientSocket(const std::string &hostname, uint16_t port_number);
|
||||
ClientSocket(const bool isRx, const std::string &hostname, uint16_t port_number);
|
||||
int sendCommandThenRead(int fnum, void *args, size_t args_size, void *retval, size_t retval_size);
|
||||
|
||||
private:
|
||||
void readReply(int &ret, void *retval, size_t retval_size);
|
||||
struct sockaddr_in serverAddr {};
|
||||
bool isReceiver;
|
||||
};
|
||||
|
||||
}; //namespace sls
|
||||
}; //namespace sls
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "sls_detector_defs.h"
|
||||
namespace sls {
|
||||
|
||||
ClientSocket::ClientSocket(const std::string &host, uint16_t port) : DataSocket(socket(AF_INET, SOCK_STREAM, 0)) {
|
||||
ClientSocket::ClientSocket(const bool isRx, const std::string &host, uint16_t port) : DataSocket(socket(AF_INET, SOCK_STREAM, 0)), isReceiver(isRx) {
|
||||
|
||||
struct addrinfo hints, *result;
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
@ -51,7 +51,7 @@ void ClientSocket::readReply(int &ret, void *retval, size_t retval_size) {
|
||||
//get error message
|
||||
receiveData(mess, sizeof(mess));
|
||||
// cprintf(RED, "%s %d returned error: %s", type.c_str(), index, mess);
|
||||
cprintf(RED, "returned error: %s", mess);
|
||||
cprintf(RED, "%s returned error: %s", (isReceiver ? "Receiver" : "Detector"), mess);
|
||||
|
||||
// unrecognized function, do not ask for retval
|
||||
if (strstr(mess, "Unrecognized Function") != nullptr)
|
||||
|
Reference in New Issue
Block a user