Timeout (HttpRequest property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:HTTPRequest:Timeout subtitle}}
{{Template:HttpRequest:Timeout subtitle}}
The <var>Timeout</var> method lets you set and query a timeout value for a <var>[[Get (HttpRequest function)|Get]]</var>, <var>[[Post (HttpRequest function)|Post]]</var>, or <var>[[Send (HttpRequest function)|Send]]</var> method invocation.  The timeout (in wall-clock seconds) is the sum of the elapsed time of all network transfers for the <var>Get</var>, <var>Post</var>, or <var>Send</var> 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).


This method lets
The <var>Timeout</var> value is also the timeout for each of the individual <var>Get</var>, <var>Post</var>, or <var>Send</var> network operations. That is, for each TCP/IP read or write operation (as well as for the
you set and query a timeout value for a <var>[[Get (HTTPRequest function)|Get]]</var>,
sum of these operations), the <var>Timeout</var> property value overrides any <var class="product">Janus</var> port definition <var>[[TIMEOUT]]</var> setting for the socket. If no <var>Timeout</var> property value is set, the port <var>TIMEOUT</var> setting (if any) is used.
<var>[[Post (HTTPRequest function)|Post]]</var>,
or <var>[[Send (HTTPRequest function)|Send]]</var> method invocation.
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>,
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 <var>Timeout</var> value is also the timeout for each of the
inidvidual <var>Get</var>, <var>Post</var>, or <var>Send</var> network operations.
That is, for each TCP/IP read or write operation (as well as for the
sum of these operations),
the <var>Timeout</var> property value overrides any <var class="product">Janus</var> port definition
<var>[[TIMEOUT]]</var> setting for the socket.
If no <var>Timeout</var> property value is set, the port <var>TIMEOUT</var> setting (if any) is used.
==Syntax==
==Syntax==
{{Template:HTTPRequest:Timeout syntax}}
{{Template:HttpRequest:Timeout syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%httpreq</th>
<tr><th>%currentNumber</th>
<td>An instantiated <var>HTTPRequest</var> object.
<td>The numeric variable for the assignment of the current value of <var>Timeout</var>.</td></tr>
<tr><th>httpRequest</th>
<td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr>
<tr><th>newNumber</th>
<td>A numeric expression that evaluates to an integer from 0 through 32767, which indicates the maximum number of wall-clock seconds that a <var>Get</var>, <var>Post</var>, or <var>Send</var> 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.
</td></tr>
</td></tr>
<tr><th>value</th>
</table>
<td>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.
</td></tr>
<tr><th>%curr</th>
<td>The numeric variable for the assignment of the current value of Timeout.


</td></tr></table>
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>Typically, you set <var>Timeout</var>
<li>Typically, you set <var>Timeout</var> to the maximum wait you want your end users to experience.
to the maximum wait you want your end users to experience.
<li>If a <var>Get</var>, <var>Post</var>, or <var>Send</var> function times out, the function response is set to <var>null</var>, $STATUSD is set to 101, and whether the request is cancelled depends on the value of the <var>Cancel</var> parameter set on the <var>Get</var>, <var>Post</var>, or <var>Send</var> call.
<li>If a <var>Get</var>, <var>Post</var>, or <var>Send</var> 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 <var>Cancel</var> parameter on the
<var>Get</var>, <var>Post</var>, or <var>Send</var> call.
</ul>
</ul>
==See also==
==See also==
{{Template:HTTPRequest:Timeout footer}}
{{Template:HttpRequest:Timeout footer}}

Latest revision as of 21:50, 21 June 2011

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.

Syntax

%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