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

SocketWrapper MbedClient read() fixes #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
facchinm merged 1 commit into arduino:main from JAndrassy:mbedclient_read_stopped_crash_fix
Jun 19, 2024

Conversation

Copy link
Contributor

@JAndrassy JAndrassy commented Jun 16, 2024
edited
Loading

this PR for SocketWrapper's MbedClient fixes crash when invoking read() on stopped client

btw. I am very surprised that read(buff, size) should return -1 if no data are available and 0 if the connection is closed. this is how it is in the documentation and in Ethernet library implementation. and apparently this is how it is in BSD sockets. it is very strange for me.
WiFi101 and Portenta Core's lwipClient return -1 too if no bytes are available
WiFiNINA, WiFiS3, esp8266, esp32 return 0 from read(buff, size) if no data are available

a complete research: https://github.com/Networking-for-Arduino/Arduino-Networking-API/blob/main/ArduinoNetAPILibs.md#clientreadbuff-size-return-value

facchinm reacted with thumbs up emoji
@JAndrassy JAndrassy force-pushed the mbedclient_read_stopped_crash_fix branch from b94442f to 13947c2 Compare June 16, 2024 16:56
@JAndrassy JAndrassy force-pushed the mbedclient_read_stopped_crash_fix branch from 13947c2 to fab0676 Compare June 16, 2024 16:59
@facchinm facchinm merged commit 14950ea into arduino:main Jun 19, 2024
Copy link
Member

Merged, thanks!

@JAndrassy JAndrassy deleted the mbedclient_read_stopped_crash_fix branch June 19, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

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