From 77d1542980b6840404830fcfb7333aab91547e08 Mon Sep 17 00:00:00 2001 From: Azzuro Date: Tue, 25 Jun 2019 22:15:58 +0200 Subject: [PATCH] MP1-4967 Increase UNCTimeOut value and allow change from mediaportal setting file by adding node under node. thx to @framug --- mediaportal/Core/Util/UNCTools.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mediaportal/Core/Util/UNCTools.cs b/mediaportal/Core/Util/UNCTools.cs index e4701721597..c9c73c6b125 100644 --- a/mediaportal/Core/Util/UNCTools.cs +++ b/mediaportal/Core/Util/UNCTools.cs @@ -30,6 +30,7 @@ public static class UNCTools static extern bool InternetGetConnectedState(ref ConnectionStatusEnum flags, int dw); static string HostDetectMethod = "Ping"; + private static int UNCTimeOut = 1500; /// /// enum to hold the possible connection states @@ -52,6 +53,7 @@ static UNCTools() using (Profile.Settings xmlreader = new Profile.MPSettings()) { HostDetectMethod = xmlreader.GetValueAsString("general", "HostDetectMethod", "Ping"); + UNCTimeOut = xmlreader.GetValueAsInt("general", "UNCTimeOut", 1500); } } @@ -519,7 +521,7 @@ private static IPAddress AsyncDNSReverseLookup(string strHost_or_IP) { var t1 = Task.Factory.StartNew(_ => DnsReverseLookup(strHost_or_IP), TaskCreationOptions.AttachedToParent) - .TimeoutAfter(1000) + .TimeoutAfter(UNCTimeOut) .ContinueWith(antecedent => { if (!(antecedent.IsCanceled || antecedent.IsFaulted))