Timeout (HttpRequest property)

From m204wiki
Jump to navigation Jump to search

Set timeout (in seconds) for HTTP method call (HttpRequest class)

The Timeout method lets you set and query a timeout value for a Get, Post, or Send method invocation. The timeout (in wall-clock seconds) is the sum of the elapsed time of all network transfers for the Get, Post, or Send request, including connecting, sending the HTTP request, and fetching all the data (independent of how many TCP/IP get operations or HTTP chunks are required to obtain the response).

The Timeout value is also the timeout for each of the individual Get, Post, or Send network operations. That is, for each TCP/IP read or write operation (as well as for the sum of these operations), the Timeout property value overrides any Janus port definition TIMEOUT setting for the socket. If no Timeout property value is set, the port TIMEOUT setting (if any) is used.


%currentNumber = httpRequest:Timeout httpRequest:Timeout = newNumber

Syntax terms

%currentNumber The numeric variable for the assignment of the current value of Timeout.
httpRequest A previously defined and instantiated HttpRequest object.
newNumber A numeric expression that evaluates to an integer from 0 through 32767, which indicates the maximum number of wall-clock seconds that a Get, Post, or Send method invocation may take. If an invalid or out of range value is specified, the request is canceled. A value of 0 (the default) means no timeout is enforced.

Usage notes

  • Typically, you set Timeout to the maximum wait you want your end users to experience.
  • If a Get, Post, or Send function times out, the function response is set to null, $STATUSD is set to 101, and whether the request is cancelled depends on the value of the Cancel parameter set on the Get, Post, or Send call.

See also