If you have a large number of google devices on your network there are two issues:
The mDNS query will fail because by default it will only wait 10 seconds for a response. Easily fixed, because there is already a timeout parameter to the device() function. For my network I had to increase it to 90 seconds.
The mDNS response is large and is stored in RAM. With a moderatley large response, either the esp8266 will crash with an OOM exception, or it might work depending on when you get the TXT response you are looking for (i.e. we break out of the response processing loop sooner), or you will get a into a loop with a cryptic "Failed to Connect" error from BearSSL since it encounters an OOM exception.
For the second issue, since we really only call mDNS once and then save the IP and port results in memory, we can probably #define NO_GLOBAL_MDNS and use MDNSResponder locally in the device() function, once the function returns the local MDNS is destoyed and the RAM is reclaimed.
If you have a large number of google devices on your network there are two issues:
For the second issue, since we really only call mDNS once and then save the IP and port results in memory, we can probably
#define NO_GLOBAL_MDNS
and useMDNSResponder
locally in thedevice()
function, once the function returns the local MDNS is destoyed and the RAM is reclaimed.Thoughts?