Since your question was quite general in asking for a solution, I will put it in, which does not require hacking the code, just a change in how you use the socket.
I just decided that my client application would send the same event, but with a different payload.
socket.emit("ev", { "name" : "miscEvent1"} ); socket.emit("ev", { "name" : "miscEvent2"} );
And on the server something like ...
socket.on("ev", function(eventPayload) { myGenericHandler(eventPayload.name); });
I don’t know if it can always use the same event, it can cause any problems, maybe some clashes on a scale, but it really helped my goals.
Dan May 27 '15 at 10:04 2015-05-27 22:04
source share