util/sock-tcp: Fix non blocking receiving, detect broken connection

This commit is contained in:
icex2
2021-01-23 23:46:22 +01:00
parent 5a78cdf7f6
commit 5a6c8e588b
+5 -2
View File
@@ -260,9 +260,12 @@ ssize_t util_sock_tcp_recv(int handle, void* buffer, size_t size, uint32_t timeo
}
return -1;
} else if (length == 0) {
// connection lost
return -1;
} else {
return length;
}
return length;
}
void util_sock_tcp_close(int handle)