处理SocketException
This commit is contained in:
parent
5d01a7dc38
commit
b5647312bf
@ -130,6 +130,11 @@ namespace FastGithub.DomainResolve
|
|||||||
{
|
{
|
||||||
return Array.Empty<IPAddress>();
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}");
|
this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user