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

NAME

6       CURLOPT_CLOSESOCKETDATA - pointer passed to the socket close callback
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CLOSESOCKETDATA,
12                                 void *pointer);
13

DESCRIPTION

15       Pass  a  pointer  that  will  be untouched by libcurl and passed as the
16       first argument in the closesocket callback set with  CURLOPT_CLOSESOCK‐
17       ETFUNCTION(3).
18

DEFAULT

20       The default value of this parameter is NULL.
21

PROTOCOLS

23       All except file:
24

EXAMPLE

26       static int closesocket(void *clientp, curl_socket_t item)
27       {
28         printf("libcurl wants to close %d now\n", (int)item);
29         return 0;
30       }
31
32       /* call this function to close sockets */
33       curl_easy_setopt(curl, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
34       curl_easy_setopt(curl, CURLOPT_CLOSESOCKETDATA, &sockfd);
35

AVAILABILITY

37       Added in 7.21.7
38

RETURN VALUE

40       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
41       if not.
42

SEE ALSO

44       CURLOPT_CLOSESOCKETFUNCTION(3), CURLOPT_OPENSOCKETFUNCTION(3),
45
46
47
48libcurl 7.85.0                   May 17, 2022       CURLOPT_CLOSESOCKETDATA(3)
Impressum