ssCore.HTTP.setOption

Sets various option values used in the HTTP communication.


Availability:

First available in version 3.8 build 333.


Input Parameters:

option - The name of the option that is to be set. Valid values include: connectTimeout,sendTimeout,receiveTimeout.

value - The value with wihich to set the selected option.


Output Parameters:

No output parameters.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.HTTP.setOption( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.HTTP.setOption( paramsObject );


Notes:

None.


Options:

name - connectTimeout

type - numeric
value range - from 1 to 4,294,967,294 or -1

The connectTimeout option affects how long, in milliseconds, that the HTTP plugin will wait while attempting to establish a connection with the HTTP server. This affects the behavior of the HTTP.getContentLength, HTTP.getHeaders, and HTTP.read commands. Setting this timeout to -1 indicates that the HTTP plugin should wait indefinitely.

By making this value fairly small, the application can test the HTTP server to see if it can accept a connection in the specified time.

//set the connect timeout to 60 seconds
ssCore.HTTP.setOption({option: "connectTimeout", value: 60000});

name - sendTimeout

type - numeric
value range - from 1 to 4,294,967,295

The sendTimeout option affects how long, in milliseconds, that the HTTP plugin will wait while attempting to send data to a connected HTTP server. This affects the behavior of the HTTP.getContentLength, HTTP.getHeaders, and HTTP.read commands.

//set the send timeout to 30 seconds
ssCore.HTTP.setOption({option: "sendTimeout", value: 30000});

name - receiveTimeout

type - numeric
value range - from 1 to 4,294,967,295

The receiveTimeout option affects how long, in milliseconds, that the HTTP plugin will wait for a response from an HTTP server request. This affects the behavior of the HTTP.getContentLength, HTTP.getHeaders, and HTTP.read commands.

By increasing this value, the HTTP plugin can be made to wait longer than normal when attempting to retrieve data from a slow server.

//set the receive timeout to 30 seconds
ssCore.HTTP.setOption({option: "receiveTimeout", value: 30000});