Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9c33670

Browse filesBrowse files
committed
client: Fix bool operator on init and ongoing use
When iterating we make sure client's socket is not closing since _tcp_client remains after close. This was tested on nuleo-f767zi using project webthing-arduino Change-Id: Ie465fe59009c33957dad97f1c70b4dc3af3b2ebe Signed-off-by: Philippe Coval <p.coval@samsung.com>
1 parent a1db02b commit 9c33670
Copy full SHA for 9c33670

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎src/EthernetClient.cpp

Copy file name to clipboardExpand all lines: src/EthernetClient.cpp
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ extern "C" {
99
#include "EthernetServer.h"
1010
#include "Dns.h"
1111

12-
EthernetClient::EthernetClient() {
12+
EthernetClient::EthernetClient()
13+
:_tcp_client(NULL) {
1314
}
1415

1516
/* Deprecated constructor. Keeps compatibility with W5100 architecture
@@ -181,7 +182,7 @@ uint8_t EthernetClient::status() {
181182
// EthernetServer::available() as the condition in an if-statement.
182183

183184
EthernetClient::operator bool() {
184-
return _tcp_client != NULL;
185+
return (_tcp_client && (_tcp_client->state != TCP_CLOSING));
185186
}
186187

187188
bool EthernetClient::operator==(const EthernetClient& rhs) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.