CURL.SetOptionLocalPortRange
----------------------------

This is the number of attempts curl should make to find a working local port number.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetOptionLocalPortRange"; curl; Value ) 

**MBS**( **"CURL.SetOptionLocalPortRange";** /\* This is the number of attempts curl should make to find a working local port number. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* The local port number attempts.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | The local port number attempts. | 1 |

### Result

Returns "OK" on success.

### Description

This is the number of attempts curl should make to find a working local port number.   
It starts with the given [CURL.SetOptionLocalPort](CURLSetOptionLocalPort.md) and adds one to the number for each retry. Setting this to 1 or below will make libcurl do only one try for the exact port number. Port numbers by nature are scarce resources that will be busy at times so setting this value to something too low might cause unnecessary connection setup failures.  
See also [LOCALPORTRANGE](https://curl.haxx.se/libcurl/c/CURLOPT_LOCALPORTRANGE.html) option in CURL manual.

### See also

- [CURL.SetOptionLocalPort](CURLSetOptionLocalPort.md)

Created 18th August 2014 , last changed 18th August 2014

  
[CURL.SetOptionLocalPort](CURLSetOptionLocalPort.md) - [CURL.SetOptionLoginOptions](CURLSetOptionLoginOptions.md)

[HTML Version](CURLSetOptionLocalPortRange.shtml)