- 论坛徽章:
- 0
|
看例子有介绍说,- CURL *curl;
- CURLcode res;
-
- curl_global_init(CURL_GLOBAL_ALL);
-
- curl = curl_easy_init();
- if(curl) {
- /* get the first document */
- curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
- res = curl_easy_perform(curl);
-
- /* get another document from the same server using the same
- connection */
- curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/docs/");
- res = curl_easy_perform(curl);
-
- /* always cleanup */
- curl_easy_cleanup(curl);
- }
复制代码 意思是说:在init成功后,cleanup之前,curl handle会保持一个长连接,比如在完成http://example.com/的请求后,再请求http://example.com/docs/,没有断开连接。
我想问的是,curl handle能保持多个服务器的长连接么?
比如,请求了163.com/aaa 后,再请求sohu.com/aaa,接着又请求163.com/bbb,那么这里到163.com是否会保持长连接? |
|