You are reading a single comment by @d0773d and its replies.
Click here to read the full conversation.
-
I guess the MQTT library could trap that error and then decide that
the socket had closed and tidy up.Is this something that will need to be implemented into the Espruino firmware or is this something that I would need to code into the IDE? Either way I wouldn't know where to begin to "trap the error"
That's what it does - hence why it works on a power bank. However it can't easily tell if an application is running on the PC or not, which is the frustrating bit :(
Yes - however what might have happened is when you save, it basically just stops everything right there, then kills all the socket connections. It means that the connection is killed, but by that point it's not running and JavaScript, so the JS never gets told the connection has been destroyed and so when it loads again it tries to use that connection and gets the error.
I guess the MQTT library could trap that error and then decide that the socket had closed and tidy up.