You mean by this.socket.close()? It's not working since Uncaught Error: Function "close" not found!.
Here is my current workaround: Before calling net.socket(), I delete all members of MyClass.socket manually:
...
for (var member in this.socket) delete this.socket[member];
this.socket = net.connect(...
Edit:
This workaround seemed to free some memory but obviously does not prevent old sockets from connecting server when possible, hence consuming memory. (I don't understand what is going on...)
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.
You mean by
this.socket.close()
? It's not working sinceUncaught Error: Function "close" not found!
.Here is my current workaround: Before calling
net.socket()
, I delete all members ofMyClass.socket
manually:Edit:
This workaround seemed to free some memory but obviously does not prevent old sockets from connecting server when possible, hence consuming memory. (I don't understand what is going on...)