Skip to content

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
Contributor

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