readBytes fix-read-endless-loop
fix readBytes endless loop
@yufewell, could you have any test to prove this change?
@yufewell, could you have any test to prove this change?
yes, cut off wi-fi then readBytes will be endless loop, i find that the stream's timed_out become true, hope it helpful.
Not sure why we would break out of a loop to stop reading but okay. The reading mechanism is flawed anyways... this is only happen while network is nearly turned off. when network is terrible, fread alwarys return empty string, so the stream will become timed out, then the loop will last forever. in my case, i need break to reconnect to server...
Not sure why we would break out of a loop to stop reading but okay. The reading mechanism is flawed anyways...
also can use keepAlive function to reconnect...
To be honest, not sure if I'm truly convinced this patch is needed. But I can be wrong...
You, wrong ? Nah !!!! :trollface: