Skip to content

setSocketOption doesn't respect inheritance #7244

Closed
@bertmelis

Description

@bertmelis

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 a WiFiClientSecure object through a WiFiClient pointer, you'll get an error.
This happens for example when you try to disable Nagle (setNoDelay).

Debug Message

[  8002][V][ssl_client.cpp:62] start_ssl_client(): Free internal heap before TLS 241696
[  8010][V][ssl_client.cpp:68] start_ssl_client(): Starting socket
[  8058][V][ssl_client.cpp:149] start_ssl_client(): Seeding the random number generator
[  8062][V][ssl_client.cpp:158] start_ssl_client(): Setting up the SSL/TLS structure...
[  8066][V][ssl_client.cpp:181] start_ssl_client(): Loading CA cert
[  8083][V][ssl_client.cpp:257] start_ssl_client(): Setting hostname for TLS session...
[  8085][V][ssl_client.cpp:272] start_ssl_client(): Performing the SSL/TLS handshake...
[  9556][V][ssl_client.cpp:293] start_ssl_client(): Verifying peer X.509 certificate...
[  9558][V][ssl_client.cpp:301] start_ssl_client(): Certificate verified.
[  9561][V][ssl_client.cpp:316] start_ssl_client(): Free internal heap after TLS 198284
[  9569][E][WiFiClient.cpp:313] setSocketOption(): fail on -1, errno: 9, "Bad file number"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions