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:
Erik Fröjdh
2019-06-05 15:25:18 +02:00
committed by Dhanya Thattil
parent a6144f658e
commit 1db7521cfa
14 changed files with 1048 additions and 1752 deletions

View File

@ -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) {