Lines Matching refs:hostName
50 * <p>An {@code InetAddress} may have a hostname (accessible via {@code getHostName}), but may not,
136 String hostName;
149 InetAddress(int family, byte[] ipaddress, String hostName) {
152 this.hostName = hostName;
188 * @param hostName the hostname corresponding to the IP address.
191 private static InetAddress[] bytesToInetAddresses(byte[][] rawAddresses, String hostName)
196 returnedAddresses[i] = makeInetAddress(rawAddresses[i], hostName);
209 * @param host the hostname or literal IP string to be resolved.
239 private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException {
241 return new Inet4Address(bytes, hostName);
243 return new Inet6Address(bytes, hostName, 0);
278 * string IP address. If the latter, the {@code hostName} field is
283 * the hostName to be resolved to an address or {@code null}.
305 if (hostName == null) {
307 hostName = getHostByAddrImpl(this).hostName;
309 hostName = getHostAddress();
312 return hostName;
316 * Returns the fully qualified hostname corresponding to this IP address.
320 return getHostByAddrImpl(this).hostName;
328 * loopback address otherwise. This method works by getting the hostname,
352 * <p>Note that if the host doesn't have a hostname set – as
379 * Resolves a hostname to its IP addresses using a cache.
381 * @param host the hostname to resolve.
406 // TODO: should getaddrinfo set the hostname of the InetAddresses it returns?
408 address.hostName = host;
440 String hostname = Libcore.os.getnameinfo(address, NI_NAMEREQD);
441 return makeInetAddress(address.ipaddress.clone(), hostname);
456 return (hostName == null ? "" : hostName) + "/" + getHostAddress();
744 * no associated hostname.
758 * <p>No reverse lookup is performed. The given {@code hostName} (which may be null) is
766 public static InetAddress getByAddress(String hostName, byte[] ipAddress) throws UnknownHostException {
767 return getByAddress(hostName, ipAddress, 0);
770 private static InetAddress getByAddress(String hostName, byte[] ipAddress, int scopeId) throws UnknownHostException {
775 return new Inet4Address(ipAddress.clone(), hostName);
781 return new Inet4Address(ipv4MappedToIPv4(ipAddress), hostName);
783 return new Inet6Address(ipAddress.clone(), hostName, scopeId);
823 new ObjectStreamField("hostName", String.class),
834 fields.put("hostName", hostName);
844 hostName = (String) fields.get("hostName", null);
853 return new Inet4Address(ipaddress, hostName);