home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Quality Assurance
Bugreports
1.22
Problem with Synology NAS ?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="azzuro" data-source="post: 1260115" data-attributes="member: 50482"><p>guy's</p><p>i do an sample of code : i hope it work, no need to set setting in MP configuration, only adding value in setting file if needed.</p><p>[code=C#]diff --git "a/mediaportal/Core/Util/UNCTools.cs" "b/mediaportal/Core/Util/UNCTools.cs"</p><p>index 65a6486745..fe1765d6af 100644</p><p>--- "a/mediaportal/Core/Util/UNCTools.cs"</p><p>+++ "b/mediaportal/Core/Util/UNCTools.cs"</p><p>@@ -30,6 +30,7 @@ namespace MediaPortal.Util</p><p> static extern bool InternetGetConnectedState(ref ConnectionStatusEnum flags, int dw);</p><p> static string HostDetectMethod = "Ping";</p><p>+ static int UNCTimeOut = 1500;</p><p> /// <summary></p><p> /// enum to hold the possible connection states</p><p>@@ -52,6 +53,7 @@ namespace MediaPortal.Util</p><p> using (Profile.Settings xmlreader = new Profile.MPSettings())</p><p> {</p><p> HostDetectMethod = xmlreader.GetValueAsString("general", "HostDetectMethod", "Ping");</p><p>+ UNCTimeOut = xmlreader.GetValueAsInt("general", "UNCTimeOut", 1500);</p><p> }</p><p> }</p><p>@@ -469,6 +471,7 @@ namespace MediaPortal.Util</p><p> break;</p><p> case IPStatus.TimedOut:</p><p> Log.Debug("UNCTools: PingHost: Connection has timed out...");</p><p>+ Log.Debug("UNCTools: UNCTimeOut set to :", UNCTimeOut , "ms");</p><p> break;</p><p> default:</p><p> Log.Debug(string.Format("PingHost: Ping failed: {0}", pingReply.Status.ToString()));</p><p>@@ -519,7 +522,7 @@ namespace MediaPortal.Util</p><p> {</p><p> var t1 = Task.Factory.StartNew(_ => DnsReverseLookup(strHost_or_IP),</p><p> TaskCreationOptions.AttachedToParent)</p><p>+ .TimeoutAfter(UNCTimeOut)</p><p> .ContinueWith(antecedent =></p><p> {</p><p> if (!(antecedent.IsCanceled || antecedent.IsFaulted))[/code]</p></blockquote><p></p>
[QUOTE="azzuro, post: 1260115, member: 50482"] guy's i do an sample of code : i hope it work, no need to set setting in MP configuration, only adding value in setting file if needed. [code=C#]diff --git "a/mediaportal/Core/Util/UNCTools.cs" "b/mediaportal/Core/Util/UNCTools.cs" index 65a6486745..fe1765d6af 100644 --- "a/mediaportal/Core/Util/UNCTools.cs" +++ "b/mediaportal/Core/Util/UNCTools.cs" @@ -30,6 +30,7 @@ namespace MediaPortal.Util static extern bool InternetGetConnectedState(ref ConnectionStatusEnum flags, int dw); static string HostDetectMethod = "Ping"; + static int UNCTimeOut = 1500; /// <summary> /// enum to hold the possible connection states @@ -52,6 +53,7 @@ namespace MediaPortal.Util using (Profile.Settings xmlreader = new Profile.MPSettings()) { HostDetectMethod = xmlreader.GetValueAsString("general", "HostDetectMethod", "Ping"); + UNCTimeOut = xmlreader.GetValueAsInt("general", "UNCTimeOut", 1500); } } @@ -469,6 +471,7 @@ namespace MediaPortal.Util break; case IPStatus.TimedOut: Log.Debug("UNCTools: PingHost: Connection has timed out..."); + Log.Debug("UNCTools: UNCTimeOut set to :", UNCTimeOut , "ms"); break; default: Log.Debug(string.Format("PingHost: Ping failed: {0}", pingReply.Status.ToString())); @@ -519,7 +522,7 @@ namespace MediaPortal.Util { var t1 = Task.Factory.StartNew(_ => DnsReverseLookup(strHost_or_IP), TaskCreationOptions.AttachedToParent) + .TimeoutAfter(UNCTimeOut) .ContinueWith(antecedent => { if (!(antecedent.IsCanceled || antecedent.IsFaulted))[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Quality Assurance
Bugreports
1.22
Problem with Synology NAS ?
Contact us
RSS
Top
Bottom