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

Commit 508d85e

Browse files
authored
Merge pull request #909 from pennam/close-fix
Fix Socket Close Hangs Indefinitely When There Is No Connectivity
2 parents e707506 + 5b31770 commit 508d85e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

‎libraries/SocketWrapper/src/MbedClient.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ void arduino::MbedClient::stop() {
275275
if (_own_socket) {
276276
delete sock;
277277
} else {
278+
sock->set_timeout(_timeout);
278279
sock->close();
279280
}
280281
sock = nullptr;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From d0f5c17e3f7a3094c80b6b239c407f1cf7ba6df9 Mon Sep 17 00:00:00 2001
2+
From: pennam <m.pennasilico@arduino.cc>
3+
Date: 2024年6月27日 13:36:31 +0200
4+
Subject: [PATCH] TLSSocketWrapper: do not force close() to block
5+
6+
---
7+
connectivity/netsocket/source/TLSSocketWrapper.cpp | 1 -
8+
1 file changed, 1 deletion(-)
9+
10+
diff --git a/connectivity/netsocket/source/TLSSocketWrapper.cpp b/connectivity/netsocket/source/TLSSocketWrapper.cpp
11+
index 1fb9c21769..c020cd9f59 100644
12+
--- a/connectivity/netsocket/source/TLSSocketWrapper.cpp
13+
+++ b/connectivity/netsocket/source/TLSSocketWrapper.cpp
14+
@@ -757,7 +757,6 @@ nsapi_error_t TLSSocketWrapper::close()
15+
16+
int ret = 0;
17+
if (_handshake_completed) {
18+
- _transport->set_blocking(true);
19+
ret = mbedtls_ssl_close_notify(&_ssl);
20+
if (ret) {
21+
print_mbedtls_error("mbedtls_ssl_close_notify", ret);
22+
--
23+
2.43.0
24+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /