WiFiClient::operator bool() always returns true


when server.available() returns WiFiClient(-1). _sock variable will be 255.

and 255 >= 0 always returns true

Yes.
“return _sock >=0;” is to check is there is a sock.

but if there is no connection. it still returns true. because uint8_t (uint8_t _sock) cannot be less than 0.

Hi @bigtiger0905, thanks for your feedback. Can you help to test if this fix is sufficient for your use case?

Thank you.

image