Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitbe067d9

Browse files
committed
client: Fix bool operator on init and ongoing use
When iterating we make sure client's socket is not closingsince _tcp_client remains after close.This was tested on nuleo-f767zi using project webthing-arduinoChange-Id: Ie465fe59009c33957dad97f1c70b4dc3af3b2ebeForwarded:#17Signed-off-by: Philippe Coval <p.coval@samsung.com>
1 parenta1db02b commitbe067d9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/EthernetClient.cpp‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ 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
1617
sketches but sock is ignored.*/
17-
EthernetClient::EthernetClient(uint8_t sock) {
18+
EthernetClient::EthernetClient(uint8_t sock)
19+
:_tcp_client(NULL) {
1820
UNUSED(sock);
1921
}
2022

@@ -181,7 +183,7 @@ uint8_t EthernetClient::status() {
181183
// EthernetServer::available() as the condition in an if-statement.
182184

183185
EthernetClient::operatorbool() {
184-
return _tcp_client !=NULL;
186+
return(_tcp_client&& (_tcp_client->state!=TCP_CLOSING));
185187
}
186188

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp