From b5647312bf9a3b85bb2ee1076afcdb80f5001601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Wed, 24 Nov 2021 09:16:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86SocketException?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.DomainResolve/DnsClient.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FastGithub.DomainResolve/DnsClient.cs b/FastGithub.DomainResolve/DnsClient.cs index 35f33bc..e34699e 100644 --- a/FastGithub.DomainResolve/DnsClient.cs +++ b/FastGithub.DomainResolve/DnsClient.cs @@ -130,6 +130,11 @@ namespace FastGithub.DomainResolve { return Array.Empty(); } + catch (SocketException ex) + { + this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}"); + return this.dnsCache.Set(key, Array.Empty(), this.maxTimeToLive); + } catch (Exception ex) { this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}");