add client retry connect server, and fix bugs