Skip to content

fix set/getSocketOption inheritance #7270

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

Closed
wants to merge 1 commit into from
Closed

fix set/getSocketOption inheritance #7270

wants to merge 1 commit into from

Conversation

bertmelis
Copy link
Contributor

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

@CLAassistant
Copy link

CLAassistant commented Sep 19, 2022

CLA assistant check
All committers have signed the CLA.

@bertmelis bertmelis closed this by deleting the head repository Nov 12, 2022
@SuGlider
Copy link
Collaborator

@bertmelis - Closed by mistake or is there a reason for it?

@SuGlider SuGlider reopened this Nov 12, 2022
@bertmelis
Copy link
Contributor Author

By mistake. I deleted the forked repo but I forgot I had this PR open.

@SuGlider
Copy link
Collaborator

By mistake. I deleted the forked repo but I forgot I had this PR open.

OK, it is not possible to merge it or to rebase it.
If possible, please, restore the branch, or maybe open a new PR.

@bertmelis
Copy link
Contributor Author

Oh. I'll recreate it exactly the same. I deleted the repo from GitHub when doing some spring cleaning. There's no way to restore.

@bertmelis
Copy link
Contributor Author

I recreated -not restored- the repo in the exact state as it was. I don't know if it is possible to merge in this state. IF not, I'll close this PR and create a new one.

@bertmelis
Copy link
Contributor Author

@SuGlider Let me know if it doesn't work. I'll make a new PR.

@VojtechBartoska VojtechBartoska added the Area: BT&Wifi BT & Wifi related issues label Nov 14, 2022
@VojtechBartoska VojtechBartoska added this to the 2.0.6 milestone Nov 16, 2022
@VojtechBartoska
Copy link
Contributor

@bertmelis seems okay, you just need to update the base branch.

@VojtechBartoska VojtechBartoska added the Resolution: Awaiting response Waiting for response of author label Nov 16, 2022
@bertmelis
Copy link
Contributor Author

Well, apparently it doesn't work. I synced the branch but the update doesn't show up here. I deleted the repo by mistake and recreated it. But in this process the PR and the new fork aren't linked anymore.

@bertmelis
Copy link
Contributor Author

Closing in favour of #7480

@bertmelis bertmelis closed this Nov 16, 2022
@VojtechBartoska
Copy link
Contributor

Thanks for new PR @bertmelis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BT&Wifi BT & Wifi related issues Resolution: Awaiting response Waiting for response of author
Projects
Development

Successfully merging this pull request may close these issues.

setSocketOption doesn't respect inheritance
6 participants