mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 00:58:01 +02:00
new constuctor
This commit is contained in:
@ -66,9 +66,6 @@ private:
|
||||
*/
|
||||
sls::ClientSocket* socket_;
|
||||
|
||||
/** index for client debugging purposes */
|
||||
int index;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -10,7 +10,9 @@ namespace sls {
|
||||
class ClientSocket : public DataSocket {
|
||||
public:
|
||||
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);
|
||||
ClientSocket(const bool isRx, struct sockaddr_in addr);
|
||||
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);
|
||||
@ -19,15 +21,17 @@ class ClientSocket : public DataSocket {
|
||||
};
|
||||
|
||||
class ReceiverSocket : public ClientSocket {
|
||||
public:
|
||||
public:
|
||||
ReceiverSocket(const std::string &hostname, uint16_t port_number)
|
||||
: ClientSocket(true, hostname, port_number){};
|
||||
ReceiverSocket(struct sockaddr_in addr) : ClientSocket(true, addr){};
|
||||
};
|
||||
|
||||
class DetectorSocket : public ClientSocket {
|
||||
public:
|
||||
public:
|
||||
DetectorSocket(const std::string &hostname, uint16_t port_number)
|
||||
: ClientSocket(false, hostname, port_number){};
|
||||
DetectorSocket(struct sockaddr_in addr) : ClientSocket(false, addr){};
|
||||
};
|
||||
|
||||
}; //namespace sls
|
||||
}; // namespace sls
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <netdb.h>
|
||||
#include <string>
|
||||
namespace sls {
|
||||
|
||||
class DataSocket {
|
||||
@ -29,4 +30,6 @@ class DataSocket {
|
||||
int ConvertHostnameToInternetAddress(const char *const hostname, struct ::addrinfo **res);
|
||||
int ConvertInternetAddresstoIpString(struct ::addrinfo *res, char *ip, const int ipsize);
|
||||
|
||||
struct ::sockaddr_in ConvertHostnameToInternetAddress(const std::string &hostname);
|
||||
|
||||
}; // namespace sls
|
||||
|
Reference in New Issue
Block a user