Skip to content

fix WiFiClient.connected() #3654

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
merged 2 commits into from
Jan 21, 2020
Merged

fix WiFiClient.connected() #3654

merged 2 commits into from
Jan 21, 2020

Conversation

MarkusAD
Copy link
Contributor

@MarkusAD MarkusAD commented Jan 21, 2020

WiFiClient.connected() was hanging thinking there was still a connection when the remote had already closed. The one-liner in this patch addresses recv() returning 0 and errno==128. I couldn't find the corresponding errno for 128 but its caught by the case statement which includes EPIPE, ENOTCONN, ECONNRESET and ECONNABORTED so I assume its one of those. Broken pipe maybe?

[D][WiFiClient.cpp:511] connected(): Disconnected: RES: 0, ERR: 128

EDIT: added comment to reflect that recv() can set errno when it returns 0.

@me-no-dev me-no-dev merged commit bb0a194 into espressif:master Jan 21, 2020
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.

2 participants