Using the TCP Client to communicate with another device and it will work for a while and then I get a [wiring] ERROR: recv error = 128 after sending a block of data(1300 - 1400 bytes in size).
What does this error actually mean and how can I prevent it?
I assume it is coming from int TCPClient::available() in spark_wiring_tcpclient_posix.cpp and this code then closes the socket.
I have tried SINGLE_THREADED_BLOCK() and nointerrupts() around the send and receive routines.
It's not clear what that is. It's an error code from sock_recv() but 128 is not a normal errno. Farther in it comes from lwip_recv() but that doesn't seem like a valid errno code for LWIP either.
I'd guess either a buffer is full or the other side closed the connection.
In any case, don't attempt to make networking calls with interrupts or threading disabled. There's a good chance that the system will deadlock if a buffer is full.
113 is connection aborted, which is what you get if the connection is abruptly closed. I think it can also happen if a router between the two sides loses the route to the other side.
Finally tracked the problem down to a pointer to data storage that no longer existed giving nonsense data that the far end didn't like and it was closing the connection.