Improve client shutdown (manage with delay) and connectivity changes