Timeout (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 2: Line 2:


This method lets
This method lets
you set and query a timeout value for a <var>[[Get (HTTPRequest function)|Get]]</var>,
you set and query a timeout value for a <var>[[Get (HttpRequest function)|Get]]</var>,
<var>[[Post (HTTPRequest function)|Post]]</var>,
<var>[[Post (HttpRequest function)|Post]]</var>,
or <var>[[Send (HTTPRequest function)|Send]]</var> method invocation.
or <var>[[Send (HttpRequest function)|Send]]</var> method invocation.
The timeout (in wall-clock seconds)
The timeout (in wall-clock seconds)
is the sum of the elaped time of all network transfers for a <var>Get</var>, <var>Post</var>, or <var>Send</var>,
is the sum of the elaped time of all network transfers for a <var>Get</var>, <var>Post</var>, or <var>Send</var>,
Line 24: Line 24:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%httpreq</th>
<tr><th>%httpreq</th>
<td>An instantiated <var>HTTPRequest</var> object.
<td>An instantiated <var>HttpRequest</var> object.
</td></tr>
</td></tr>
<tr><th>value</th>
<tr><th>value</th>

Revision as of 20:17, 16 June 2011

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


This 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 elaped time of all network transfers for a Get, Post, or Send, 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 inidvidual 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.

Syntax

%currentNumber = httpRequest:Timeout httpRequest:Timeout = newNumber

Syntax terms

%httpreq An instantiated HttpRequest object.
value 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.
%curr The numeric variable for the assignment of the current value of Timeout.

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 on the Get, Post, or Send call.

See also