[Bug?]WiFiClient.connected doesnt notice connection loss.
Posted: Sun Jul 09, 2017 6:39 pm
as the headline states. WiFiClient.connected doesnt change when the client ESP loses power, or otherwise loses connection.
here is my code https://pastebin.com/0dk6EXyE
connect to port 10000 and send LED(ON); or LED(OFF); to switch pin 2 on and off.
as you see im looping using while(client.connected()). when i now power off the client esp, that is sending messages in a loop (basically a remote blink), the server will always get a true returned. the connected method uses errno to check if anything went wrong, but errno stays at 11, before and after powering off the client esp. that leads to the server endlessly looping and waiting for data from a dead connection.
can maybe someone from the team say something about this?
here is my code https://pastebin.com/0dk6EXyE
connect to port 10000 and send LED(ON); or LED(OFF); to switch pin 2 on and off.
as you see im looping using while(client.connected()). when i now power off the client esp, that is sending messages in a loop (basically a remote blink), the server will always get a true returned. the connected method uses errno to check if anything went wrong, but errno stays at 11, before and after powering off the client esp. that leads to the server endlessly looping and waiting for data from a dead connection.
can maybe someone from the team say something about this?