• 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(...


    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...)


Avatar for ceremcem @ceremcem started