I font this solution to listening the internal ping pong. Internal library of Socket.io i.e. engine.io triggers the 'heartbeat' event after sending pong event to client. you can listen to this event using following hack.
I tried to override the socket.io in new file but it not work. currently following code works for me.
You can use following code also, without overriding the internal working.