HTTP Connection close doesn't clear the buffer
Posted: Sat Feb 28, 2015 10:44 am
If I make two connections and call them one after the other, closing the first one before opening the second, the second call loses returned data.
I made one call to the Wunderground API which returned a JSON string of about 587 chars. Did a conn:close() and then called a second JSON string (different address) which returned a JSON string of around 2641 chars.
The first payload is complete, the second payload is incomplete. Clearly the first connection is leaving data in the buffer. We need a way to clear the buffer inbetween connections for HTTP connections.
I made one call to the Wunderground API which returned a JSON string of about 587 chars. Did a conn:close() and then called a second JSON string (different address) which returned a JSON string of around 2641 chars.
The first payload is complete, the second payload is incomplete. Clearly the first connection is leaving data in the buffer. We need a way to clear the buffer inbetween connections for HTTP connections.