call unregisterFromServiceEvents() in both server and client.