The WaitForUpdatesEx method supports a polling mechanism for property collection that is based on a specified wait time.

Specify the following parameters when you call WaitForUpdatesEx:

  • Managed object reference to a PropertyCollector instance.
  • version value that identifies a sequence value. The first time you call WaitForUpdatesEx, specify an empty string (““) to retrieve a complete set of results for the specified properties. Your subsequent calls should use the version value returned in the previous call. If you don’t include the version value, the server returns everything. For more information about data versions, see Server Data Transmission.
  • options specifying the amount of data to transmit in a single response (the WaitOptions.maxObjectUpdates property) and the number of seconds the PropertyCollector should wait for updates (the WaitOptions.maxWaitSeconds property).

The value of the WaitOptions.maxWaitSeconds property determines whether the PropertyCollector uses an instant retrieval or a polling model. When you call WaitForUpdatesEx with a wait time of 0, it checks for updates and returns immediately. When you call WaitForUpdatesEx with a wait time greater than 0, the method waits until the specified time or until a change. WaitForUpdatesEx will not return a result until updates occur or until the call times out. The time-out is affected by the maxWaitSeconds value, the amount of time it takes to collect updated property values, and PropertyCollector policy.

If the property collection operation times out, and there are no updates to the requested properties, the PropertyCollector returns null for the WaitForUpdatesEx response.

  • maxWaitSeconds is an optional property. If you do not specify a value, the PropertyCollector waits as long as possible for updates. Therefore, if maxWaitSeconds is unset, the waitForUpdatesEx method will cause the server to wait if there are no more changes to report, until the server times out the communication and drops the request. You can use maxWaitSeconds to specify a shorter time-out interval if the client-side firewall times out sooner than the server.
  • maxWaitSeconds set to zero specifies an immediate call and response. The PropertyCollector checks for updates for all properties specified by the union of all filters associated with that instance of the PropertyCollector. The PropertyCollector returns any results, or null if there have been no updates.
  • maxWaitSeconds greater than zero specifies how long the server should wait before timing out the request. If there are no updates available within maxWaitSeconds, WaitForUpdatesEx returns null instead of a set of updates.