产品介绍
应用场景
产品优势
产品限制
OkHttpClient mOkHttpClient =new OkHttpClient.Builder().dns(new Dns() {@Overridepublic List<InetAddress> lookup(String hostname) {String ips = MSDKDnsResolver.getInstance().getAddrByName(hostname);String[] ipArr = ips.split(";");if (0 == ipArr.length) {return Collections.emptyList();}List<InetAddress> inetAddressList = new ArrayList<>(ipArr.length);for (String ip : ipArr) {if ("0".equals(ip)) {continue;}try {InetAddress inetAddress = InetAddress.getByName(ip);inetAddressList.add(inetAddress);} catch (UnknownHostException ignored) {}}return inetAddressList;}}).build();
mRetrofit =new Retrofit.Builder().client(mOkHttpClient).baseUrl(baseUrl).build();
文档反馈