-
Notifications
You must be signed in to change notification settings - Fork 7.6k
setSocketOption doesn't respect inheritance #7244
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
Comments
@bertmelis I am facing the same issue. Can you suggest any workaround or fix for it? It would be really helpful |
Make it virtual (in WiFiClient) or cast your pointer to WiFiClientSecure before calling setSocketOption. The former is a fix, the latter unpractical. |
Hi @bertmelis, |
In WiFiClient.h change lines 89 and 90 from: int setSocketOption(int option, char* value, size_t len);
int setSocketOption(int level, int option, const void* value, size_t len); to: virtual int setSocketOption(int option, char* value, size_t len);
virtual int setSocketOption(int level, int option, const void* value, size_t len);
|
Extra: |
As an alternative, one could implement |
@VojtechBartoska Unless you find this not an issue, I'm happy to create a PR. But there are many roads to Rome and I can only pick one. So guide me in the desired direction. Imho, we should remove the |
Hi @bertmelis, thanks for the PR. We will review it and we will see if this is a good option :) |
Core version
latest master (checkout manually)
Issue
https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiClient.h#L89
setSocketOption
isn't virtual so when calling for aWiFiClientSecure
object through aWiFiClient
pointer, you'll get an error.This happens for example when you try to disable Nagle (
setNoDelay
).Debug Message
The text was updated successfully, but these errors were encountered: