def METHOD_NAME(self: Client, *args, **kwargs):
    try_count = 0
    while try_count < 3:
        try:
            f(self, *args, **kwargs)
            break
        except (ConnectionResetError, BrokenPipeError):
            self.stop()
            time.sleep(1)
            self.check_adb_alive()
            self.start()
            try_count += 1
    else:
        raise RuntimeError('Failed to start scrcpy-server.')