Skip to content

Commit fffb35a

Browse files
lucasssvazNPaolini
andcommitted
fix(network): Avoid returning zero if connection is not dropped
Co-authored-by: NPaolini <[email protected]>
1 parent 3dd4b0d commit fffb35a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/Network/src/NetworkClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ uint8_t NetworkClient::connected() {
549549
}
550550
if (_connected) {
551551
uint8_t dummy;
552-
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
552+
int res = recv(fd(), &dummy, 1, MSG_DONTWAIT | MSG_PEEK);
553553
// avoid unused var warning by gcc
554554
(void)res;
555555
// recv only sets errno if res is <= 0

0 commit comments

Comments
 (0)