do I have to remove event listener when socket is disconnected?

后端 未结 1 1664
北海茫月
北海茫月 2021-02-13 06:31

In socket.io, when the client is disconnected from the server the disconnect event is fired in the server for the socket. Do I have to removeAllEventListeners

1条回答
  •  后悔当初
    2021-02-13 07:26

    After digging through the socket.io source, the socket object (which is the EventEmitter) is deleted when the client disconnects so it is not necessary to manually call removeAllListeners.

    0 讨论(0)
提交回复
热议问题