Implemented async connect.