陈国伟 3 лет назад
Родитель
Сommit
b5647312bf
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      FastGithub.DomainResolve/DnsClient.cs

+ 5 - 0
FastGithub.DomainResolve/DnsClient.cs

@@ -130,6 +130,11 @@ namespace FastGithub.DomainResolve
             {
                 return Array.Empty<IPAddress>();
             }
+            catch (SocketException ex)
+            {
+                this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}");
+                return this.dnsCache.Set(key, Array.Empty<IPAddress>(), this.maxTimeToLive);
+            }
             catch (Exception ex)
             {
                 this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}");