def get_connection(
            self, name_or_addr, ssl=False, sock_type=None, read_timeout=None):
        ctx = context.get_context()
        address_aliases = self.address_aliases or ctx.address_aliases
        #ops_config = self.ops_config or ctx.ops_config
        #### POTENTIAL ISSUE: OPS CONFIG IS MORE SPECIFIC THAN ADDRESS (owch)
        if isinstance(gevent.get_hub().resolver, gevent.resolver_thread.Resolver):
            gevent.get_hub().resolver = _Resolver()  # avoid pointless thread dispatches

        if name_or_addr in address_aliases:
            name_or_addr = address_aliases[name_or_addr]

        if isinstance(name_or_addr, basestring):  # string means a name
            name = name_or_addr
            address_list = self.get_all_addrs(name)
        else:
            address_list = [name_or_addr]
            # default to a string-ification of ip for the name
            name = address_list[0][0].replace('.', '-')

        #if name:
        #    sock_config = ops_config.get_endpoint_config(name)
        #else:
        #    sock_config = ops_config.get_endpoint_config()
        sock_config = DEFAULT_CONNECT_INFO


        # ensure all DNS resolution is completed; past this point
        # everything is in terms of ips
        def get_gai(e):
            name = e[0].replace(".","-")
            with ctx.log.info('DNS', name) as _log:
                gai = gevent.socket.getaddrinfo(*e, family=gevent.socket.AF_INET)[0][4]
            context.get_context().name_cache[e] = (time.time(), gai)
            return gai

        def cache_gai(e):
            if context.get_context().name_cache.has_key(e):
                age, value = context.get_context().name_cache[e]
                if time.time() - age > 600:
                    async.spawn(get_gai, e)
                return value
            else:
                return get_gai(e)

        with ctx.log.get_logger('DNS.CACHE').info(name) as _log:
            _log['len'] = len(address_list)
            address_list = [cache_gai(e) for e in address_list]

        with ctx.log.get_logger('COMPACT').info(name):
            self._compact(address_list, name)

        errors = []
        for address in address_list:
            try:
                log_name = '%s:%s' % (name, address[0])
                with ctx.log.get_logger('CONNECT').info(log_name) as _log:
                    s = self._connect_to_address(
                        name, ssl, sock_config, address, sock_type, read_timeout)
                    if hasattr(s, 'getsockname'):
                        _log["lport"] = s.getsockname()[1]
                    elif hasattr(s, '_sock'):
                        _log["lport"] = s._sock.getsockname()[1]
                    return s
            except socket.error as err:
                if len(address_list) == 1:
                    raise
                ml.ld("Connection err {0!r}, {1}, {2!r}", address, name, err)
                errors.append((address, err))
        raise MultiConnectFailure(errors)
The SocketInfo used for the initial query.
dataset/ETHPy150Open paypal/support/support/connection_mgr.py/ConnectionManager.get_connection--crossover with--dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/response.py/ExhaustResponse.socket_info