You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WiFiServer appears to have an empty destructor, and does not automatically call stop() or end() when deleted like esp32 does.
Depending on the project, this may cause the port listen to fail on the 2nd and subsequent attempts if for example, WiFi is connected, a port is listened, the WiFi connection is lost, and then a connection is re-established and begin() is called again on a new WiFiServer object with the same port.
If the project didn't check for success after calling begin() (this isn't exposed very well, so I'm using status() != CLOSED to infer the result of the internal test !listen_pcb), then the device can even appear to re-connect but then reboot via abort() on the subsequent first incoming connection.
Expected Behavior
I would expect that WiFiServer's destructor should clean up all owned resources as is C++ convention, so that projects that don't use it as a singleton can delete and new it again to reset the state without any memory or resource leaks.
The text was updated successfully, but these errors were encountered:
Basic Infos
Platform
Settings in IDE
Problem Description
WiFiServer appears to have an empty destructor, and does not automatically call
stop()
orend()
when deleted like esp32 does.Depending on the project, this may cause the port listen to fail on the 2nd and subsequent attempts if for example, WiFi is connected, a port is listened, the WiFi connection is lost, and then a connection is re-established and
begin()
is called again on a new WiFiServer object with the same port.If the project didn't check for success after calling
begin()
(this isn't exposed very well, so I'm usingstatus() != CLOSED
to infer the result of the internal test!listen_pcb
), then the device can even appear to re-connect but then reboot viaabort()
on the subsequent first incoming connection.Expected Behavior
I would expect that WiFiServer's destructor should clean up all owned resources as is C++ convention, so that projects that don't use it as a singleton can
delete
andnew
it again to reset the state without any memory or resource leaks.The text was updated successfully, but these errors were encountered: