From 224e0d112622abedc9515956990a9ffb59475e6c Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Wed, 20 Aug 2025 15:22:02 +0800 Subject: [PATCH] =?UTF-8?q?axihttp=20DNS=E7=BA=BF=E7=A8=8B=E5=AE=89?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/AppMain/AxiHttp/AxiHttp.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttp.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttp.cs index 9b651903..82c200be 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttp.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/AxiHttp/AxiHttp.cs @@ -166,20 +166,23 @@ public static class AxiHttp public static IPAddress GetDnsIP(string str) { - if (!dictIP2Address.ContainsKey(str)) + lock (dictIP2Address) { - IPHostEntry host = Dns.GetHostEntry(str); - IPAddress ip = null; - foreach (var item in host.AddressList) + if (!dictIP2Address.ContainsKey(str)) { - if (item.AddressFamily == AddressFamily.InterNetwork) + IPHostEntry host = Dns.GetHostEntry(str); + IPAddress ip = null; + foreach (var item in host.AddressList) { - ip = item; break; + if (item.AddressFamily == AddressFamily.InterNetwork) + { + ip = item; break; + } } + dictIP2Address[str] = ip; } - dictIP2Address[str] = ip; + return dictIP2Address[str]; } - return dictIP2Address[str]; } public enum AxiDownLoadMode