passing callback function in overriding socket.io on() nodejs

I referred Socket.io : How do I handle all incoming messages on the server? answered by Ganesh Kumar to override the on() but i am unable to pass a callback function as argument. Why is it so? Can't i pass callback function in this?

My code snippet is like:

socket.$emit = function(callback)
{
   ....
   callback()
}

It is flagging error and treating callback as string. Am I doing something wrong?

In the regular emit function you cannot pass a callback.

In the overridden version you can only accept the same arguments as the regular version.