"Bad file number" error when server closes the connection #9230
Labels
Area: Libraries
Issue is related to Library support.
Area: WiFi
Issue related to WiFi
Status: Awaiting triage
Issue is waiting for triage
Board
Any with Wi-Fi
Device Description
Tested using ESP32 And ESP32-S3 devkits.
Hardware Configuration
Button with PD on GPIO 35 or change GPIO in the example to the BOOT button.
Version
latest master (checkout manually)
IDE Name
Arduino IDE
Operating System
Linux
Flash frequency
40MHz
PSRAM enabled
no
Upload speed
115200
Description
When the server closes the connection and mbedtls notifies it using
MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY
, manysetSocketOption(): fail on 0, errno: 9, "Bad file number"
errors happen. It appears to be caused when checking connection withWiFiClientSecure::connected()
(needs confirmation, haven't checked too deeply). It doesn't affect the functionality of the code but expected behavior is for the function to returnfalse
and not throw errors.Sketch
Example from #9103
Debug Message
The text was updated successfully, but these errors were encountered: