Skip to content
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

fix set/getSocketOption inheritance #7480

Merged
merged 2 commits into from Dec 8, 2022
Merged

fix set/getSocketOption inheritance #7480

merged 2 commits into from Dec 8, 2022

Conversation

bertmelis
Copy link
Contributor

This is an exact replacement for #7270

Description of Change

  • changed int WiFiClient::fd() const to virtual int WiFiClient::fd() const
  • created int WiFiClientSecure::fd() const
  • removed setSocketOption, getSocketOption from WiFiClientSecure to deduplicate the code.

setSocketOption, getSocketOption, getOption, and setOption in WiFiClient operate on fd(). With this fix they all operate on the correct socket.

setNoDelay and getNoDelay now also works for WiFiClientSecure.

Tests scenarios

tested using WiFiclientSecure and WiFiClient on esp32devkit v1, connected and setNoDelay.
Tested using the MQTT client as referenced to in the issue #7244

Related links

Closes #7244

@VojtechBartoska
Copy link
Collaborator

VojtechBartoska commented Nov 16, 2022

Already reviewed by @me-no-dev & @P-R-O-C-H-Y.

@SuGlider please help with review and merge this. Thank you.

@mrengineer7777
Copy link
Collaborator

Looks like a good fix. Nice work!

@SuGlider SuGlider merged commit 394f721 into espressif:master Dec 8, 2022
@bertmelis bertmelis deleted the fix-setSocketOption-inheritance branch December 8, 2022 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

setSocketOption doesn't respect inheritance
4 participants