What I do for the other stuff is if there's an error, I clean up everything I can and then just return -1 to and calls to send and recv. Once send or recv return -1, the HTTP client/server automatically shuts everything down.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
wrt network errors:
What I do for the other stuff is if there's an error, I clean up everything I can and then just return
-1
to and calls to send and recv. Oncesend
orrecv
return -1, the HTTP client/server automatically shuts everything down.