@mdma Ok - think I have both got a work around for this and replicated it within a single .cpp
file.
In my code, I noticed that my UDP socket would return -26
(INVALID_SOCKET
) after a reconnection. So I had been recycling the socket every time I reconnected.
I noticed if I started a 5 second timer after WiFi.ready()
returns true, and use its completion to recycle my socket, I would not see the problem I have been seeing above and everything reconnects fine.
I have replicated this in a single application.cpp
here:
It seems to take up to 10 reconnection attempts to cause it sometimes but I have seen it with as few as 3 or 4.