Skip to content

Commit 396c158

Browse files
Zephyr client lib: fix connected() function
1 parent c11b69f commit 396c158

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/SocketWrapper/ZephyrClient.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ class ZephyrClient : public arduino::Client, ZephyrSocketWrapper {
4141
}
4242
#endif
4343
uint8_t connected() override {
44+
uint8_t buf;
45+
int ret = ::recv(sock_fd, &buf, 1, MSG_PEEK | MSG_DONTWAIT);
46+
if (ret == 0) {
47+
stop();
48+
}
4449
return _connected;
4550
}
4651

0 commit comments

Comments
 (0)