correctly handle connection problems on server and router.