Resolves the host & port of this RedisClient instance.
@return {[string, number|string]} an array containing the host and port
426058
function resolveHostAndPort() {
  return this._options ? [this._options.host || defaultHost, this._options.port || defaultPort] :
    [defaultHost, defaultPort];
}
955130
function start(port, host, password, debug) {
	/*jshint validthis: true */
	DEBUG_DISPATCHER = debug;
	redisPort = port;
	redisHost = host;
	redisPassword = password;
	redisPublisher = redis.createClient(port, host, password);
	return this;
}
987599
function(host, next) {
    var tokens = tldtools.extract(host),
      resolvingHost;

    if (ipaddr.IPv4.isValid(host) || ipaddr.IPv6.isValid(host) ) {
      next(false, [ host ], host);
    } else {
      resolvingHost = tokens.inspect.getDomain() || tokens.domain;
      dns.resolve(resolvingHost, function(err, aRecords) {
        next(err, aRecords, resolvingHost );
      });
    }
  }
179147
def _get_service_port(self, instance):
        
        host = instance.get('host', DEFAULT_HOST)
        port = instance.get('port', DEFAULT_PORT)
        # default port is the name of the service but lookup would fail
        # if the /etc/services file is missing. In that case, fallback to numeric
        try:
            socket.getaddrinfo(host, port)
        except socket.gaierror:
            port = DEFAULT_PORT_NUM

        return port
1297834
def port(self):
        
        try:
            rv = int(to_native(self._split_host()[1]))
            if 0 <= rv <= 65535:
                return rv
        except (ValueError, TypeError):
            pass
213379
public static String[] getByInternalAPI() {
        try {
            Class<?> resolverConfiguration =
                    Class.forName("sun.net.dns.ResolverConfiguration");
            Method open = resolverConfiguration.getMethod("open");
            Method getNameservers = resolverConfiguration.getMethod("nameservers");
            Object instance = open.invoke(null);
            List nameservers = (List) getNameservers.invoke(instance);
            if (nameservers == null || nameservers.size() == 0) {
                return null;
            }
            String[] ret = new String[nameservers.size()];
            int i = 0;
            for (Object dns : nameservers) {
                ret[i++] = (String) dns;
            }
            return ret;
        } catch (Exception e) {
            // we might trigger some problems this way
            e.printStackTrace();
        }
        return null;
    }
444526
function splitHostPort(hostport) {

   let host = hostport;
   let port = 80;
   const parts = hostport.split(':');
   if (parts.length > 1) {
      host = parts[0];
      port = parts[1];
   }

   return {'host': host, 'port': port};
}
1351953
function(key, dest, containerName) {

      // Attempt to connect to redis
      return getRedisClient()

      // Run the redis query and then quit
      .then(function(redis) {
        log.debug(format('Setting DNS. %s => %s', key, dest));
        return Promise.fromNode(function(cb) {
          redis.multi()
          .del(key)
          .rpush(key, containerName)
          .rpush(key, dest)
          .exec(cb);
        })
        .then(function() {
          redis.quit();
        });
      });

    }
63006
def get_connection(self, internal=False):
        
        # Determine the connection string to use.
        connect_string = self.connect_string
        if internal:
            connect_string = self.internal_connect_string

        # Stripe Redis protocol prefix coming from the API.
        connect_string = connect_string.strip('redis://')
        host, port = connect_string.split(':')

        # Build and return the redis client.
        return redis.StrictRedis(host=host, port=port, password=self._password)
833175
static RedisNodeDescription findNodeByHostAndPort(Collection<RedisNodeDescription> nodes, String host, int port) {
        for (RedisNodeDescription node : nodes) {
            RedisURI nodeUri = node.getUri();
            if (nodeUri.getHost().equals(host) && nodeUri.getPort() == port) {
                return node;
            }
        }
        return null;
    }
1008026
function getRegistryUrl (resolved) {
  if (!resolved) {
    return ''
  }

  let resolvedUrl = ''

  try {
    const urlObj = new url.URL(resolved)
    resolvedUrl = `${urlObj.protocol}//${urlObj.host}`
  } catch (error) {
    debug('url parse error: %o', error)
  }

  return resolvedUrl
}
20638
def _get_hosts_from_ports(self, ports):
        
        hosts = map(lambda x: 'localhost:%d' % int(x.strip()), ports.split(','))
        return list(set(hosts))
1258833
public function resolveHost()
    {
        $host = $this->getHost();

        if ($host == null) {
            //check to see if there is an AuthenticationToken from which to retrieve it:
            $token = $this->getAuthenticationToken();
            //if ($token instanceof $HostAuthenticationToken) {
            if($token)
                $host = 'API Services';
            //}
        }

        if ($host == null) {
            $session = $this->resolveSession();
            if ($session != null) {
                $host = $session->getHost();
            }
        }

        return $host;

    }
524637
public InetAddress []
lookupAllHostAddr(String host) throws UnknownHostException {
	Name name = null;

	try {
		name = new Name(host);
	}
	catch (TextParseException e) {
		throw new UnknownHostException(host);
	}

	Record [] records = null;
	if (preferV6)
		records = new Lookup(name, Type.AAAA).run();
	if (records == null)
		records = new Lookup(name, Type.A).run();
	if (records == null && !preferV6)
		records = new Lookup(name, Type.AAAA).run();
	if (records == null)
		throw new UnknownHostException(host);

	InetAddress[] array = new InetAddress[records.length];
	for (int i = 0; i < records.length; i++) {
		Record record = records[i];
		if (records[i] instanceof ARecord) {
			ARecord a = (ARecord) records[i];
			array[i] = a.getAddress();
		} else {
			AAAARecord aaaa = (AAAARecord) records[i];
			array[i] = aaaa.getAddress();
		}
	}
	return array;
}
846923
private HostInfo getClientHost() {
        String host = AppProperties.get(SSRKeys.SSR_CLIENT_HOST).orElse(null);
        if (isEmpty(host)) {
            logger.info("Client host not provided using '{}' to discover host address", discovery.getClass().getSimpleName());
            return discovery.resolveHost();
        } else {
            logger.info("Client host provided: {}", host);
            InetAddress address = tryParse(host);
            if (address != null) {
                return new HostInfo(address.getHostAddress(), address.getHostName());
            }
            return new HostInfo(host, host);
        }
    }
772965
def wait_until_host_is_available(host, get_ip=false)
      resolved_host = Resolv.getaddresses(host).first
      if resolved_host.nil?
        print("Waiting for #{host} to resolve")
        wait_until('ready!') { resolved_host = Resolv.getaddresses(host).first }
      end
      host = resolved_host if get_ip
      unless remote_is_available?(host)
        print("Waiting for #{host} to accept connections")
        wait_until('ready!') { remote_is_available?(host) }
      end
      return host
    end
1230577
def get_host_port(spec, default_port):
    ""
    args = (spec.split(':', 1) + [default_port])[:2]
    args[1] = int(args[1])
    return args[0], args[1]