产品概述
功能介绍
产品优势
应用场景
基本概念
SMHService.dnsFetch = QCloudHttpClient.QCloudDnsFetch { hostname ->//根据hostname获取对应的IP列表//返回对应的InetAddress列表return inetAddressList;}}
SMHService.dnsFetch = QCloudHttpClient.QCloudDnsFetch { hostname ->val ips = MSDKDnsResolver.getInstance().getAddrByName(hostname)val ipArr = ips.split(";")if (ipArr.isEmpty()) {emptyList<InetAddress>()} else {val inetAddressList: MutableList<InetAddress> = ArrayList(ipArr.size)for (ip in ipArr) {if ("0" == ip) {continue}try {val inetAddress = InetAddress.getByName(ip)inetAddressList.add(inetAddress)} catch (ignored: UnknownHostException) {}}inetAddressList}}
文档反馈