Do we have an option to cleanup socket object without a hard reset?
I'm connecting to a server with a tricky path and I need to try to reconnect with net.connect on any error. But this process consumes memory on every attempt.
Minimal pseudo-like code is as follows:
function MyClass(....){
this.socket = null
}
MyClass.prototype.connect = function (){
this.socket = net.connect(....)
}
var my = new MyClass(..)
my.connect()
my.connect()
my.connect()
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.
Hi everybody,
Do we have an option to cleanup socket object without a hard reset?
I'm connecting to a server with a tricky path and I need to try to reconnect with
net.connect
on any error. But this process consumes memory on every attempt.Minimal pseudo-like code is as follows: