1CURLOPT_LOCALPORTRANGE(3)  curl_easy_setopt options  CURLOPT_LOCALPORTRANGE(3)
2
3
4

NAME

6       CURLOPT_LOCALPORTRANGE - number of additional local ports to try
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_LOCALPORTRANGE,
12                                 long range);
13

DESCRIPTION

15       Pass  a long. The range argument is the number of attempts libcurl will
16       make to find a working local port number. It starts with the given CUR‐
17       LOPT_LOCALPORT(3)  and  adds  one to the number for each retry. Setting
18       this option to 1 or below will make libcurl do only  one  try  for  the
19       exact  port  number.  Port  numbers by nature are scarce resources that
20       will be busy at times so setting this value to something too low  might
21       cause unnecessary connection setup failures.
22

DEFAULT

24       1
25

PROTOCOLS

27       All
28

EXAMPLE

30       CURL *curl = curl_easy_init();
31       if(curl) {
32         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
33         curl_easy_setopt(curl, CURLOPT_LOCALPORT, 49152L);
34         /* and try 20 more ports following that */
35         curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, 20L);
36         ret = curl_easy_perform(curl);
37         curl_easy_cleanup(curl);
38       }
39

AVAILABILITY

41       Added in 7.15.2
42

RETURN VALUE

44       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
45       if not.
46

SEE ALSO

48       CURLOPT_LOCALPORT(3), CURLOPT_INTERFACE(3),
49
50
51
52libcurl 7.66.0                 January 31, 2019      CURLOPT_LOCALPORTRANGE(3)
Impressum