1.22.0 Problem with Synology NAS ? (1 Viewer)

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,956
    5,629
    France - IDF
    Home Country
    France France
    How about MP Configurator?
    one of the place can be in WOL setting.
    but i think this setting can be used by TV and all other stuff.
    so hard to place it, or keep in MP setting XML, but none in MP config. so need to be edited manually.
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,943
    2,022
    South of France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #12
    How about MP Configurator?

    --
    WBR, ajs :):whistle::coffee:
    Well, some years ago, when I proposed this kind of thing, answer was "we already have too many settings".
    And also, remember that it is a timeout timer.
    If NAS answer before, we don't have to wait until 1.5 second, if I understand correctly.
    So, are you sure it is worth to ?
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,956
    5,629
    France - IDF
    Home Country
    France France
    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:
    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))
     

    Attachments

    • UNCtimeout.patch
      2 KB

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,943
    2,022
    South of France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #14
    :confused: But why create a gaz factory just for an int, a timeout timer ?
    xmlreader use I/O and then, take time and ressources.
    We have no other asyncDNS in MP client code than here.
    And also, you create a static which should be avoided and this, for a private method...
     
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,765
    10,779
    Kyiv
    Home Country
    Ukraine Ukraine
    May be move timeout read part to MP start procedure? On start MP read timeout value and use it ... ?

    --
    WBR, ajs :):whistle::coffee:
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,765
    10,779
    Kyiv
    Home Country
    Ukraine Ukraine
    Add new method in UNCTools.cs like ReadAndCacheTimeout and call it when MP start...

    --
    WBR, ajs :):whistle::coffee:
     

    framug

    Super Moderator
  • Team MediaPortal
  • January 31, 2005
    5,943
    2,022
    South of France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #19
    Again :
    Who need to change this timeout value ?
     

    Users who are viewing this thread

    Top Bottom