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

WiFiServer - don't inherit from Server class #8418

Merged
merged 5 commits into from
Jan 3, 2022

Conversation

JAndrassy
Copy link
Contributor

@JAndrassy JAndrassy commented Dec 19, 2021

The base type Server is useless because it doesn't declare any method to get a client so it can't be used as base type reference or pointer.
Server inherits from Print, but ESP8266WiFi library's WiFiServer doesn't implement the print-to-all-clients functionality, inheriting from Print only adds virtual methods overhead.
My addition the ArduinoWiFiServer class implements the print-to-all-clients functionality so it needs to inherit from Print.

I created and maintain two networking libraries (WiFiEspAT and EnternetENC) and both don't use the Server class and have a separate class for server with print-to-all-clients functionality. There are no issues with this.

EDIT: It is not a breaking change.

@JAndrassy JAndrassy marked this pull request as draft December 19, 2021 19:51
@JAndrassy JAndrassy marked this pull request as ready for review December 19, 2021 19:53
@JAndrassy JAndrassy marked this pull request as draft December 21, 2021 17:51
JAndrassy and others added 2 commits December 21, 2021 19:03
Fixes esp8266#8416

We install now a private Python and use it for OTA calls, so users do not need to manually install anything.
@JAndrassy JAndrassy marked this pull request as ready for review December 21, 2021 18:35
Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
It is a non-sense for WiFiServer to inherit from Print without implementing properly Print functions.
OK to assume it is not a breaking change.

@d-a-v d-a-v merged commit d0cc3a8 into esp8266:master Jan 3, 2022
@JAndrassy JAndrassy deleted the WiFiServer_not_inherit branch November 24, 2023 18:19
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request Nov 18, 2024
* WiFiServer - don't inherit from Server class
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.

3 participants