def connecttobootstrap(self):
        tries = 0
        keeptrying = True
        while tries < BOOTSTRAPCONNECTTIMEOUT and keeptrying:
            for bootpeer in self.bootstrapset:
                try:
                    if self.debug: self.logger.write("State",
                                                     "trying to connect to bootstrap: %s" % str(bootpeer))
                    helomessage = create_message(MSG_HELO, self.me)
                    successid = self.send(helomessage, peer=bootpeer)
                    if successid < 0:
                        tries += 1
                        continue
                    keeptrying = False
                    break
                except socket.error as e:
                    if self.debug: self.logger.write("Socket Error",
                                                     "cannot connect to bootstrap: %s" % str(e))
                    tries += 1
                    continue
            time.sleep(1)
dataset/ETHPy150Open denizalti/concoord/concoord/node.py/Node.connecttobootstrap/original