mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
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:

committed by
Dhanya Thattil

parent
a6144f658e
commit
1db7521cfa
@ -15,12 +15,16 @@ class DataSocket {
|
||||
void swap(DataSocket &other) noexcept;
|
||||
DataSocket(const DataSocket &) = delete;
|
||||
DataSocket &operator=(DataSocket const &) = delete;
|
||||
int getSocketId() const {
|
||||
return socketId_;
|
||||
}
|
||||
int getSocketId() const { return socketId_; }
|
||||
int sendData(const void *buffer, size_t size);
|
||||
|
||||
template <typename T> int sendData(T &&data) {
|
||||
return sendData(&data, sizeof(data));
|
||||
}
|
||||
|
||||
int receiveData(void *buffer, size_t size);
|
||||
int read(void *buffer, size_t size);
|
||||
int write(void *buffer, size_t size);
|
||||
int setTimeOut(int t_seconds);
|
||||
int setReceiveTimeout(int us);
|
||||
void close();
|
||||
@ -30,9 +34,12 @@ class DataSocket {
|
||||
int socketId_ = -1;
|
||||
};
|
||||
|
||||
int ConvertHostnameToInternetAddress(const char *const hostname, struct ::addrinfo **res);
|
||||
int ConvertInternetAddresstoIpString(struct ::addrinfo *res, char *ip, const int ipsize);
|
||||
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);
|
||||
struct ::sockaddr_in
|
||||
ConvertHostnameToInternetAddress(const std::string &hostname);
|
||||
|
||||
}; // namespace sls
|
||||
|
Reference in New Issue
Block a user