I just looked at a socket in Firebug, there is a member called "_allbacks".
It contains all the registered callbacks, so finding, if already registered, is simple as:
if ( socket._callbacks[strHandlerName] == undefined ) { //Handler not present, install now socket.on(strHandlerName, function () { ... } ); }
Here it is!
source share