Doing something useful on socket events