From b26aecf7e8bb31e5555e81d0d1fb81482f289a4b Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sat, 13 Feb 2021 12:39:21 +0800 Subject: [PATCH] fix ICMPing async warning --- Netch/Models/Server.cs | 2 +- Netch/Utils/Utils.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Netch/Models/Server.cs b/Netch/Models/Server.cs index cac7051b..647c2b74 100644 --- a/Netch/Models/Server.cs +++ b/Netch/Models/Server.cs @@ -79,7 +79,7 @@ namespace Netch.Models { try { - return Global.Settings.ServerTCPing ? await Utils.Utils.TCPingAsync(destination, Port) : await Utils.Utils.ICMPing(destination, Port); + return Global.Settings.ServerTCPing ? await Utils.Utils.TCPingAsync(destination, Port) : Utils.Utils.ICMPing(destination, Port); } catch (Exception) { diff --git a/Netch/Utils/Utils.cs b/Netch/Utils/Utils.cs index dd34569a..2ac925e5 100644 --- a/Netch/Utils/Utils.cs +++ b/Netch/Utils/Utils.cs @@ -56,7 +56,7 @@ namespace Netch.Utils return timeout; } - public static async Task ICMPing(IPAddress ip, int timeout = 1000) + public static int ICMPing(IPAddress ip, int timeout = 1000) { var reply = new Ping().Send(ip, timeout);