mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +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
@ -51,7 +51,11 @@ int DataSocket::receiveData(void *buffer, size_t size) {
|
||||
}
|
||||
|
||||
int DataSocket::read(void *buffer, size_t size){
|
||||
return ::read(getSocketId(), reinterpret_cast<char *>(buffer), size);
|
||||
return ::read(getSocketId(), buffer, size);
|
||||
}
|
||||
|
||||
int DataSocket::write(void *buffer, size_t size){
|
||||
return ::write(getSocketId(), buffer, size);
|
||||
}
|
||||
|
||||
int DataSocket::setReceiveTimeout(int us) {
|
||||
@ -64,13 +68,11 @@ int DataSocket::setReceiveTimeout(int us) {
|
||||
|
||||
|
||||
int DataSocket::sendData(const void *buffer, size_t size) {
|
||||
int dataSent = 0;
|
||||
while (dataSent < (int)size) {
|
||||
dataSent +=
|
||||
write(getSocketId(), reinterpret_cast<const char *>(buffer) + dataSent,
|
||||
size - dataSent);
|
||||
}
|
||||
return dataSent;
|
||||
// int dataSent = 0;
|
||||
// while (dataSent < (int)size) {
|
||||
return ::write(getSocketId(), buffer, size);
|
||||
// }
|
||||
// return dataSent;
|
||||
}
|
||||
|
||||
int DataSocket::setTimeOut(int t_seconds) {
|
||||
|
Reference in New Issue
Block a user