WiFi-class issue (minor) [solved]

Hi there, folks! I'm a newbie, here.

I recognized a minor fail in the WiFi-library, which is very easy to correct. But it took me one whole day to step after this issue, so I want to share that experience:

The situation in brief is, that I want to send one binary value, byte, to a registered WiFi-client ESP8266 D1 mini. This thing will put this byte onto an PCF8574 via i2c.

Now then, after confirming with

"WiFiClient client = server.available();"

the subsequent "req = client.read();" returns "-1", empty buffer, so that the channel is positively "up", but the data is not yet present.

A "delay(20);" did the trick; lower values did not work out right.

With one "while (!req) { return; }" that same thing could be done, but here this is one 8-bit-wide byte, so what.

Hope this helps, cheers, Jack.

usually client.available() is used to test if some data are in receive buffer