Skip to content

web.setConnectionTimeout

Sets the maximum time allowed for establishing an HTTP connection before timing out. The default connection timeout is 120 seconds.

js
web.setConnectionTimeout(seconds)

Parameters

  • seconds (integer): The number of seconds before the connection attempt times out.

Examples

js
web.setConnectionTimeout(60); // Set connection timeout to 60 seconds

Notes

  • The connection timeout applies only to the initial connection phase, meaning it does not affect the time taken for data transfer once a connection is established.
  • If the timeout is reached before a connection is established, the request will be aborted, and an error will be returned.