add a yield here for esp32 to avoid a busy loop

if data isn't available yet, but is expected, yielding here is nicer
than burning the cpu in a loop, just like in esp8266 case.
This commit is contained in:
Ben Hencke
2020-02-15 06:43:46 -08:00
parent c038f100d6
commit ebd7a528ac

View File

@ -625,6 +625,9 @@ bool WebSockets::readCb(WSclient_t * client, uint8_t * out, size_t n, WSreadWait
if(!client->tcp->available()) {
#if(WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266)
delay(0);
#endif
#if(WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32)
yield();
#endif
continue;
}