WMI ConnectionOptions with Timeout.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DKn
    New Member
    • Aug 2007
    • 53

    WMI ConnectionOptions with Timeout.

    Hello all,

    How this Timeout option is useful ?

    When i am going for WMI connection i have given this Timeout option , Still for connection is taking 5 to 6 seconds.
    ConnectionOptio ns.Timeout = new TimeSpan(0, 0, 2);

    Actually in this case, According to my knowledge on TimeOut property ,It should get WMI connection success or failure with in 2 seconds, but still it is taking time up to 5 seconds.

    With out this timeout option also observed the same time taken for WMI connection.

    Please any one tell me, In which respective the timeout option will be useful.
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Originally posted by DKn
    Hello all,

    How this Timeout option is useful ?

    When i am going for WMI connection i have given this Timeout option , Still for connection is taking 5 to 6 seconds.
    ConnectionOptio ns.Timeout = new TimeSpan(0, 0, 2);

    Actually in this case, According to my knowledge on TimeOut property ,It should get WMI connection success or failure with in 2 seconds, but still it is taking time up to 5 seconds.

    With out this timeout option also observed the same time taken for WMI connection.

    Please any one tell me, In which respective the timeout option will be useful.
    WMI connection specially to remote computer takes time... quite a few seconds... i guess 2 secs is way to less....
    Timeout MSDN
    Acc to MSDN ...timeout property (remember its ManagementOptio ns.Timeout Property ... inherited)
    "Gets or sets the time-out to apply to the operation. Note that for operations that return collections, this time-out applies to the enumeration through the resulting collection, not the operation itself (the ReturnImmediate ly property is used for the latter)"

    i guess... connection failure or server not found in WMI... for remote PC... there is more than one attempt to establish a connection .. before timing out...

    Comment

    • PRR
      Recognized Expert Contributor
      • Dec 2007
      • 750

      #3
      "The ManagementOptio ns.Timeout property is intended for WMI semi-sync
      operations. In particular, the ConnectionOptio n.Timeout property is not used
      to control the timeout for a WMI connection. This is because the underlying
      WMI COM API doesn't support specifying a timeout value. The timeout value is
      default to the value DCOM specifies (usually 60secs). You can adjust this
      value via dcomcnfg.exe. "
      Andy Cheung

      i guess you could first establish that the client exists .. Ping
      then you could try n connect to the remote pc..
      Run dcomcnfg.exe-> Go to mycomputer properties -> options-> tansaction timeout..

      Comment

      • DKn
        New Member
        • Aug 2007
        • 53

        #4
        Originally posted by DeepBlue
        "The ManagementOptio ns.Timeout property is intended for WMI semi-sync
        operations. In particular, the ConnectionOptio n.Timeout property is not used
        to control the timeout for a WMI connection. This is because the underlying
        WMI COM API doesn't support specifying a timeout value. The timeout value is
        default to the value DCOM specifies (usually 60secs). You can adjust this
        value via dcomcnfg.exe. "
        Andy Cheung

        i guess you could first establish that the client exists .. Ping
        then you could try n connect to the remote pc..
        Run dcomcnfg.exe-> Go to mycomputer properties -> options-> tansaction timeout..
        Hi,
        Thanks for you reply.

        I changed that Transaction timeout under dcomcnfg from 60 sec to 10 sec.
        Then I tried to test whether this change is effecting or not.
        Purposely I tried to connect to the non existing host which will take more time.
        Still the WMIScope.Connec t() method is taking around 45 sec to execute.
        It should come out with in 10 sec right? Please give some input. I don't want to wait until the default time as you said 60 sec..

        Comment

        • PRR
          Recognized Expert Contributor
          • Dec 2007
          • 750

          #5
          Originally posted by DKn
          Hi,
          Thanks for you reply.

          I changed that Transaction timeout under dcomcnfg from 60 sec to 10 sec.
          Then I tried to test whether this change is effecting or not.
          Purposely I tried to connect to the non existing host which will take more time.
          Still the WMIScope.Connec t() method is taking around 45 sec to execute.
          It should come out with in 10 sec right? Please give some input. I don't want to wait until the default time as you said 60 sec..
          non existing host?? i guess its becoz the connection attempt is made more than once... besides i guess the timeout time of 60 sec ... possibly cannot be reduced...(as far as i know)...
          you could establish first that the client exists and then "know" that all your clients OS support WMI .. After that you could connect?

          Comment

          Working...