【发布时间】:2015-07-24 05:37:53
【问题描述】:
- 假定讨论请求连接到同一目标主机
- "handles" -> 我的意思是 curl_init() 的返回
- 即使来自 CURLOPT_FORBID_REUSE 选项的文档也没有提及如果未设置该选项,是否会在不同的 curl 句柄之间发生连接重用。
我搜索了很多,甚至 CURL 的官方常见问题解答,但找不到明确的答案。
备注:与问题Reusing the same curl handle. Big performance increase?相关,但接受的答案没有明确回答,也没有官方参考。
【问题讨论】:
-
也许这会回答你的问题:curl.haxx.se/docs/faq.html#What_about_Keep_Alive_or_persist
curl and libcurl have excellent support for persistent connections when transferring several files from the same server. Curl will attempt to reuse connections for all URLs specified on the same command line/config file, and libcurl will reuse connections for all transfers that are made using the same libcurl handle. -
@blubear 谢谢。请使它成为一个答案。所以我认为答案是否定的。