Skip to content

SocketWrapper: Refactoring Socket management#227

Open
leonardocavagnis wants to merge 7 commits intoarduino:mainfrom
leonardocavagnis:eth_wrapper_fix
Open

SocketWrapper: Refactoring Socket management#227
leonardocavagnis wants to merge 7 commits intoarduino:mainfrom
leonardocavagnis:eth_wrapper_fix

Conversation

@leonardocavagnis
Copy link
Member

No description provided.

@leonardocavagnis
Copy link
Member Author

After investigation, the issue comes from the destructor in libraries/SocketWrapper/SocketWrapper.h:

~ZephyrSocketWrapper() {
    if (sock_fd != -1) {
         ::close(sock_fd);
    }
}

Removing these lines prevents the socket from being closed unexpectedly, and the Telnet session works as expected.
I’ve opened the PR with this change, but this is likely not the correct long-term fix.

Tagging @andreagilardoni to see if he can help point us toward the right approach.

@leonardocavagnis leonardocavagnis marked this pull request as ready for review November 11, 2025 12:14
@leonardocavagnis leonardocavagnis changed the title Socket Wrapper: fix close and connected functions SocketWrapper: Refactoring Socket management Nov 11, 2025
@leonardocavagnis leonardocavagnis force-pushed the eth_wrapper_fix branch 3 times, most recently from a22d972 to 51563e5 Compare November 11, 2025 14:48
@leonardocavagnis leonardocavagnis force-pushed the eth_wrapper_fix branch 2 times, most recently from 3a8b676 to 472ebb4 Compare November 14, 2025 15:21
@leonardocavagnis
Copy link
Member Author

Please note that the code in this PR is fully functional and addresses issue #251. The encountered 'single connection' limitation does not stem from this library's logic, but from an incorrect Zephyr network configuration (see PR: #351).

cc @pennam

@pennam pennam force-pushed the eth_wrapper_fix branch from c613a97 to d88cf20 Compare March 4, 2026 09:39
@pennam pennam force-pushed the eth_wrapper_fix branch from d88cf20 to 3605386 Compare March 4, 2026 10:14
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Built 0.53.2-0.dev+3605386

CI run PASSED 🟢

ArtifactBoardCoreTestsRAMSketchesWarningsErrors
✅* zephyr_contrib ek_ra8d1 📗 ✅*

11.9%

22-
frdm_mcxn947 3 🏷️ ✅*

58.0%

22-
frdm_rw612 1 🏷️ ✅*

83.0%

22-
✔️* zephyr_main giga 4 🏷️ ✅*

54.5%

4414-
nano33ble 1 🏷️ ✅*

78.7%

2210-
nano_matter 📗 ✔️*

⚠️ 85.7%

166(2*)
niclasense 2 🏷️ ✅*

⚠️ 87.3%

2010-
opta 4 🏷️ ✔️*

46.7%

5628(2*)
portentac33 3 🏷️ ✔️*

⚠️ 95.1%

5830(8*)
portentah7 3 🏷️ ✔️*

47.3%

6030(2*)
✅* zephyr_unoq unoq 📗 ✅*

26.3%

5210-
Legend

BoardTestStatus description
🔥 🔥 Test run failed to complete.
🔴 Test completed with unexpected errors.
✔️* 🚫 Test completed with errors, but all are known/expected.
✅* 🟡 Test completed with some warnings; no errors detected.
🟢 Test passed successfully, with no warnings or errors.
🌑 🌑 Test was skipped.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telnet connection closes immediately when running Zephyr-adapted Advanced Chat Server example

3 participants