Yield in blocking send and receive
Yield in blocking send and receive

With the existing code, the tcp transmit buffer can fill up during the
Particle Cloud handshake because there is no yield to let the ESP8266
send out data. This results in the tcp connection being dropped and
a new one opened, with the handshake repeated again. This manifests as
the Particle Cloud showing the device cycling online-offline every
second or so.

The buffer must be right on the threshold of filling up, because this
only happens for some people, and only some of the time. I suspect it's
sensitive to the local Wifi environment (latency, interference, packets
from other devices, etc).

Yielding solves this issue. There are multiple points in the code where
the yield(s) could be inserted. I chose to put them after the send in
blocking_send() and before the receive in blocking_receive(), since by
definition these functions should block until the data is sent or
received, and there is an inherent expectation that these functions
can take some time to execute.

digistump/OakCore,pfeerick/OakCore,pfeerick/OakCore,digistump/OakCore,digistump/OakCore,pfeerick/OakCore,pfeerick/OakCore,pfeerick/OakCore,digistump/OakCore,digistump/OakCore