curl / Mailing Lists / curl-library / Single Mail

curl-library

imaps + CURLOPT_CONNECT_ONLY + CURLINFO_ACTIVESOCKET vs. multi interface

From: Deweloper <deweloper_at_wp.pl>
Date: Wed, 22 Mar 2017 12:09:44 +0100

Hi,

Unfortunately I was unable to find a description on how to use
CURLINFO_ACTIVESOCKET with the multi interface, neither at
https://curl.haxx.se/libcurl/c/CURLINFO_ACTIVESOCKET.html nor in the
examples at https://curl.haxx.se/libcurl/c/example.html .

I have already discovered that after getting CURLMSG_DONE the easy
handle must remain added to the multi handle, otherwise
curl_easy_getinfo(CURLINFO_ACTIVESOCKET) gives CURL_SOCKET_BAD.
Later I found this information by browsing the curl source code
(inside the body of Curl_getconnectinfo). Maybe it's worth including in
the manual page of CURLINFO_ACTIVESOCKET ?

The manual also says:
> When you finish working with the socket, you must call
> curl_easy_cleanup as usual on the easy handle
What if I want to repeat the transfer? Isn't it allowed to call
curl_easy_perform again on the same handle?
And, more importantly, what to do in the case of multi interface?
Is it sufficient to call curl_multi_remove_handle and
curl_multi_add_handle to repeat the transfer?

-- 
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-03-22