copy connection_manager_thread from conncection_manager