Closed gabrielcipriano closed 2 months ago
closes #25
This is how the reconnect on destroy was happening:
receiver.destroy()
this.#socket.destroy()
#socket
#handleSocketClose()
#socketRetry()
this.connect()
Remove the listener of #socket close event when destroying, breaking the restart event chain:
this.#socket.removeListener('close', this.#socketCloseListener)
closes #25
This is how the reconnect on destroy was happening:
receiver.destroy()
this.#socket.destroy()
#socket
emits 'close' event#handleSocketClose()
calls#socketRetry()
#socketRetry()
schedulesthis.connect()
solution:
Remove the listener of #socket close event when destroying, breaking the restart event chain:
receiver.destroy()
this.#socket.removeListener('close', this.#socketCloseListener)
this.#socket.destroy()
#socket
emits 'close' event, but receiver is not listening to it anymore :)