Latency

The Latency virtual method sets or retrieves the timeout for queries.

Virtual Method Synopsis

Latency([$timeoutMilliseconds])

Parameters

$timeoutMilliseconds
Specifies the timeout, in milliseconds, for the queries. This is an optional parameter and if omitted (that is, no timeout is specified) it returns the value of the timeout.

Description

The Latency virtual method:

  • Sets a timeout, in milliseconds, for queries if a timeout value is passed to the $timeoutMilliseconds parameter. The value passed to $timeoutMilliseconds cannot be the undef value.
  • Returns the timeout, in milliseconds, for queries if the $timeoutMilliseconds parameter is omitted (that is, no timeout is specified). If an acknowledgement is not received within this time, further requests are sent up to the retry limit. (The retry limit is specified in a call to the RetryLimit virtual method). If no acknowledgement is received after (retry*timeout), an error is returned to the caller.

Example Usage

The following examples assume a previous call to the RIV::App constructor, which returns a client/server application object to $app. A call could also be made to the RIV::Agent constructor, which returns a discovery agent application object (typically, to $agent).

The following example shows a call with no $timeoutMilliseconds parameter specified:

$latency = $app->Latency();

The following example shows a call with the $timeoutMilliseconds parameter specified:

$app->Latency(1000);

Returns

Upon completion, the Latency virtual method returns the timeout, in milliseconds, if the $timeoutMilliseconds parameter is omitted.

See Also