(network_info, getaddrinfo=asyncio.get_event_loop().getaddrinfo)
return superpeer_ip_queue
Accepts network_info type (from pycoinnet.helpers.networks) and returns an asyncio.queue.

    You MUST call queue.task.close() on the return value when you're done with it.
Accepts network_info type (from pycoinnet.helpers.networks) and returns an asyncio.queue.
Accepts network_info type ( from pycoinnet . helpers . networks ) and returns an asyncio . queue .
def dns_bootstrap_host_port_q(network_info, getaddrinfo=asyncio.get_event_loop().getaddrinfo):
    """
    Accepts network_info type (from pycoinnet.helpers.networks) and returns an asyncio.queue.

    You MUST call queue.task.close() on the return value when you're done with it.
    """
    dns_bootstrap = network_info["DNS_BOOTSTRAP"]

    superpeer_ip_queue = asyncio.Queue()

    @asyncio.coroutine
    def bootstrap_superpeer_addresses(dns_bootstrap):
        for h in dns_bootstrap:
            try:
                r = yield from getaddrinfo(h, network_info["DEFAULT_PORT"])
                results = set(t[-1][:2] for t in r)
                for t in results:
                    yield from superpeer_ip_queue.put(t)
                    logging.debug("got address %s", t)
            except Exception:
                logging.exception("problem in bootstrap_superpeer_addresses")
        yield from superpeer_ip_queue.put(None)

    superpeer_ip_queue.task = asyncio.Task(bootstrap_superpeer_addresses(dns_bootstrap))
    return superpeer_ip_queue
def dns_bootstrap_host_port_q ( network_info , getaddrinfo = asyncio . get_event_loop ( ) . getaddrinfo ) : dns_bootstrap = network_info [ "DNS_BOOTSTRAP" ] superpeer_ip_queue = asyncio . Queue ( ) @ asyncio . coroutine def bootstrap_superpeer_addresses ( dns_bootstrap ) : for h in dns_bootstrap : try : r = yield from getaddrinfo ( h , network_info [ "DEFAULT_PORT" ] ) results = set ( t [ - 1 ] [ : 2 ] for t in r ) for t in results : yield from superpeer_ip_queue . put ( t ) logging . debug ( "got address %s" , t ) except Exception : logging . exception ( "problem in bootstrap_superpeer_addresses" ) yield from superpeer_ip_queue . put ( None ) superpeer_ip_queue . task = asyncio . Task ( bootstrap_superpeer_addresses ( dns_bootstrap ) ) return superpeer_ip_queue