like once('close') in server.js, since a user could call removeAllListeners('close')
I wrote a small failing test case for this
Does this issue belong in engine.io-client?
Follow up: it seems like very little code depends on events internally in the client code: https://github.com/LearnBoost/engine.io-client/blob/master/lib/socket.js
@brishin yeah, looks like 5 instances each of .on() and .once(). There's also an instance in lib/util.js and many more in the various lib/transports
@davidhcummings Right, but there are only 3(?) instances of using the Emitter on the Socket object.
I don't think that the lib/transports are important because users shouldn't be messing with the transport objects anyway.
Faced with same issue.
I understand that it's not a real issue but mistake in code that based on engine.io.
But if I need to remove all close listeners from socket using socket.removeAllListeners('close') it will cause a memory leak into application. Because server.clients would be never cleaned and connection amount wouldn't reduce after some socket closes connection.
Because of this: https://github.com/socketio/engine.io/blob/master/lib/server.js#L334
This block would never be reached
Might be it makes sense to split internal events and events that developers could rely on ?
For example for internal use could be created internal-close event but for usage normal close event would be fired ?