1CURLOPT_CLOSESOCKETDATA(3) curl_easy_setopt options CURLOPT_CLOSESOCKETDATA(3)
2
3
4
6 CURLOPT_CLOSESOCKETDATA - pointer passed to the socket close callback
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CLOSESOCKETDATA, void
12 *pointer);
13
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
20 The default value of this parameter is NULL.
21
23 All except file:
24
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
37 Added in 7.21.7
38
40 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
41 if not.
42
44 CURLOPT_CLOSESOCKETFUNCTION(3), CURLOPT_OPENSOCKETFUNCTION(3),
45
46
47
48libcurl 7.64.0 November 07, 2018 CURLOPT_CLOSESOCKETDATA(3)