MediaTek-Labs / Arduino-Add-On-for-LinkIt-SDK

Arduino board support package for LinkIt 7697
https://docs.labs.mediatek.com/resource/linkit7697-arduino/en
35 stars 33 forks source link

WiFiClient.available() is too slow #4

Closed pablosun closed 7 years ago

pablosun commented 7 years ago

It always takes ~4 seconds for WiFiClient::available() to become true. This is strange since the server already gave response.

pablosun commented 7 years ago

available() takes a long time not because of receiving data, but the request is buffered in lwIP and send too late. After force flushing after calling tcp_write, the wait time reduced from ~3 secs to < 1 sec.