mirror of
https://github.com/pumpitupdev/pumptools.git
synced 2026-09-25 07:37:56 +03:00
util/sock-tcp: Fix non blocking receiving, detect broken connection
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user