I have some code for a socket.io server along the lines of:
var io = require("socket.io");
io = io(server);
io.on('connection', connectionHandler);
This all works great. I'm wondering how I can remove that connection listener - unlike socket, it appears that
io.removeListener('connection', connectionHandler);
doesn't work (I get "io.removeListener is not a function"). How do I remove that on('connection') listener?
If it matters, I'm working on a socket.io room managing library, and am writing a reset function. I'm using the reset function between test suites with Mocha. I'd like the reset function to remove the on connection listener.
Socket.io version is 1.3.7