From d9afb0e25ab61e689217eff7f836235bad6956fb 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, 29 Sep 2021 15:01:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E4=BD=BF=E7=94=A8=E5=B9=B6=E5=8F=91pi?= =?UTF-8?q?ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Build.props | 2 +- FastGithub.DomainResolve/IPAddressCollection.cs | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index f66d363..a535dde 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 2.0.2-SmartIPAddress + 2.0.2 enable github加速神器 https://github.com/dotnetcore/FastGithub diff --git a/FastGithub.DomainResolve/IPAddressCollection.cs b/FastGithub.DomainResolve/IPAddressCollection.cs index 9659161..c6fbac3 100644 --- a/FastGithub.DomainResolve/IPAddressCollection.cs +++ b/FastGithub.DomainResolve/IPAddressCollection.cs @@ -51,19 +51,12 @@ namespace FastGithub.DomainResolve /// Ping所有IP /// /// - public Task PingAllAsync() + public async Task PingAllAsync() { - var items = this.ToItemArray(); - if (items.Length == 0) + foreach (var item in this.ToItemArray()) { - return Task.CompletedTask; + await item.PingAsync(); } - if (items.Length == 1) - { - return items[0].PingAsync(); - } - var tasks = items.Select(item => item.PingAsync()); - return Task.WhenAll(tasks); } ///