1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

Better handling of wifi disconnect (#231)

When network interface is down, some nasty things happen, for instance tcp_connect returns without ever calling error callback.
This change adds some workarounds for that: before doing a tcp connect and DNS resolve we check if there is a route available.
Also added a listener for wifi events which stops (aborts) all the WiFiClients and WiFiUDPs when wifi is disconnected. This should
help libraries detect disconnect properly.
This commit is contained in:
Ivan Grokhotkov
2015-06-11 18:01:08 +03:00
parent 567d401ed3
commit e6e57a8b81
7 changed files with 118 additions and 12 deletions

View File

@ -313,6 +313,7 @@ protected:
static void _scanDone(void* result, int status);
void * _getScanInfoByIndex(int i);
static void _smartConfigCallback(uint32_t status, void* result);
static void _eventCallback(void *event);
bool _smartConfigStarted = false;
bool _smartConfigDone = false;