Skip to content

Commit b795a1a

Browse files
ZephyrClient: refactor close fun
1 parent 21f770e commit b795a1a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

libraries/SocketWrapper/SocketWrapper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class ZephyrSocketWrapper {
2222
}
2323

2424
~ZephyrSocketWrapper() {
25+
// close();
2526
}
2627

2728
bool connect(const char *host, uint16_t port) {

libraries/SocketWrapper/ZephyrClient.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ class ZephyrClient : public arduino::Client, ZephyrSocketWrapper {
4747
uint8_t buf;
4848
int ret = ::recv(sock_fd, &buf, 1, MSG_PEEK | MSG_DONTWAIT);
4949
if (ret == 0) {
50-
_connected = false;
51-
::close(sock_fd);
52-
sock_fd = -1;
50+
stop();
5351
return false;
5452
}
5553
return _connected;

0 commit comments

Comments
 (0)