def METHOD_NAME(self):
    mdnsLocator.locate_brewpi_services()  # This causes all the BrewPi devices to resend their mDNS info
    connected = False
    # TODO - Debug this. Currently, reconnection doesn't actually work.
    while self.retryCount < self.retries:
        try:
            self.sock.connect((self.host, self.port))
            connected = True
            break
        except (socket.gaierror) as e:
            self.retryCount += 1
            # time.sleep(1)
        except (socket.error) as e:  # Catches "bad file descriptor" error
            self.retryCount += 1
            # time.sleep(1)
    if connected:
        logMessage("Successfully connected to controller.")
        self.retryCount = 0
    else:
        logMessage("Unable to connect to BrewPi " + self.host + " on port " + str(self.port) + ". Exiting.")
        sys.exit(1)