CURL.SetOptionForbidReuse
-------------------------

Whether to disallow reusing connections.

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

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

**MBS**( **"CURL.SetOptionForbidReuse";** /\* Whether to disallow reusing connections. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* Whether to disallow reusing connections.e.g. 0 \*/ 

(old name: CURL.SetOptionForbitReuse)

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | Whether to disallow reusing connections. | 0 |

### Result

Returns "OK" on success.

### Description

Whether to disallow reusing connections.  
Set to 1 to make the next transfer explicitly close the connection when done. Normally, libcurl keeps all connections alive when done with one transfer in case a succeeding one follows that can re-use them. This option should be used with caution and only if you understand what it does. Set to 0 to have libcurl keep the connection open for possible later re-use (default behavior).  
see also [CURL.SetOptionFreshConnect](CURLSetOptionFreshConnect.md).  
See also [FORBID\_REUSE](https://curl.haxx.se/libcurl/c/CURLOPT_FORBID_REUSE.html) option in CURL manual.

### Examples

Forbit reusing connection:

 MBS ( "CURL.SetOptionForbitReuse"; $curl ; 1 )  
Forbit reuse and make fresh connection:

 Set Variable \[$EmailID ; Value: MBS ( "CURL.SetOptionForbitReuse"; $curl ; 1 ) \]  
Set Variable \[$EmailID ; Value: MBS ( "[CURL.SetOptionFreshConnect](CURLSetOptionFreshConnect.md)"; $curl ; 1 ) \]  
### See also

- [CURL.SetOptionConnectionTimeout](CURLSetOptionConnectionTimeout.md)
- [CURL.SetOptionConnectOnly](CURLSetOptionConnectOnly.md)
- [CURL.SetOptionFreshConnect](CURLSetOptionFreshConnect.md)
- [CURL.SetOptionTimeOut](CURLSetOptionTimeOut.md)

Created 18th August 2014 , last changed 20th April 2018

  
[CURL.SetOptionFollowLocation](CURLSetOptionFollowLocation.md) - [CURL.SetOptionFreshConnect](CURLSetOptionFreshConnect.md)

[HTML Version](CURLSetOptionForbidReuse.shtml)