

def _test_burp_server_address(self, addr, retry=False):
    'The :func:`burpui.misc.backend.burp1.Burp._test_burp_server_address`\n        function determines if the given address is reachable or not.\n\n        :param addr: Address to look at\n        :type addr: str\n\n        :param retry: Flag to stop trying because this function is recursive\n        :type retry: bool\n\n        :returns: True or False wether we could find a valid address or not\n        '
    family = Burp._get_inet_family(addr)
    try:
        sock = socket.socket(family, socket.SOCK_STREAM)
        sock.connect((addr, self.port))
        sock.close()
        return True
    except socket.error:
        self._logger('warning', 'Cannot contact burp server at %s:%s', addr, self.port)
        if (not family):
            new_addr = ''
            if (self.host == '127.0.0.1'):
                new_addr = '::1'
            else:
                new_addr = '127.0.0.1'
            self._logger('info', 'Trying %s:%s instead', new_addr, self.port)
            if self._test_burp_server_address(new_addr, True):
                self._logger('info', '%s:%s is reachable, switching to it for this runtime', new_addr, self.port)
                self.host = new_addr
                self.family = Burp._get_inet_family(new_addr)
                return True
            self._logger('error', 'Cannot guess burp server address')
    return False

dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp1.py Burp._test_burp_server_address/VarMisuse@92/278 `retry`->`family`