Adding socket.io events.