博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
man curl_easy_perform(原创)
阅读量:6969 次
发布时间:2019-06-27

本文共 3716 字,大约阅读时间需要 12 分钟。

curl_easy_perform(3)           libcurl 手册                  curl_easy_perform(3)

名字

curl_easy_perform - 执行一个阻塞文件传输
摘要
#include <curl/curl.h>
CURLcode curl_easy_perform(CURL *easy_handle);curl_easy_perform
描述
调用此函数后会默认调用curl_easy_init(3)和所有的curl_easy_setopt(3),并将执行所述选项中所述的传输。它必须被easy_handle作为输入的curl_easy_init相同(3)调用返回。curl_easy_perform(3)执行一个阻塞的方式和返回时完成整个请求,或者如果它失败了。非阻塞的行为,看到curl_multi_perform(3)。
你可以做任何数量的要求curl_easy_perform(3)同时使用相同的easy_handle。如果你打算传输一个以上的文件,你甚至鼓励这样做。libcurl将试图使用相同的连接的传输,从而使作品‐tions更快,更少的CPU密集使用较少的网络资源。只是注意,你将不得不使用curl_easy_setopt(3)之间的调用为以下curl_easy_perform设置选项。
你必须调用这个函数同时使用相同的easy_handle两地。让函数返回前先调用另一个时间。如果你想要并行传输,必须使用多个卷easy_handles。

而easy_handle添加到多处理,不能用curl_easy_perform(3)。

返回值:

curle_ok(0)意味着一切都是好的,非零均值发生错误 <curl/curl.h> 定义见libcURL错误(3)。如果我‐lopt_errorbuffer(3)是集curl_easy_setopt(3)会有一个可读的错误的错误消息时,非零返回缓冲区。
范例
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}

请参考

curl_easy_init(3), curl_easy_setopt(3), curl_multi_add_handle(3), curl_multi_perform(3), libcurl-errors(3),

libcurl 7.7      5 Mar 2001      curl_easy_perform(3)

 

 

原文:

1 curl_easy_perform(3)                                           libcurl Manual                                           curl_easy_perform(3) 2  3  4  5 NAME 6        curl_easy_perform - perform a blocking file transfer 7  8 SYNOPSIS 9        #include 
10 11 CURLcode curl_easy_perform(CURL *easy_handle);12 13 DESCRIPTION14 Invoke this function after curl_easy_init(3) and all the curl_easy_setopt(3) calls are made, and will perform the transfer as15 described in the options. It must be called with the same easy_handle as input as the curl_easy_init(3) call returned.16 17 curl_easy_perform(3) performs the entire request in a blocking manner and returns when done, or if it failed. For non-blocking behav‐18 ior, see curl_multi_perform(3).19 20 You can do any amount of calls to curl_easy_perform(3) while using the same easy_handle. If you intend to transfer more than one21 file, you are even encouraged to do so. libcurl will then attempt to re-use the same connection for the following transfers, thus22 making the operations faster, less CPU intense and using less network resources. Just note that you will have to use23 curl_easy_setopt(3) between the invokes to set options for the following curl_easy_perform.24 25 You must never call this function simultaneously from two places using the same easy_handle. Let the function return first before26 invoking it another time. If you want parallel transfers, you must use several curl easy_handles.27 28 While the easy_handle is added to a multi handle, it cannot be used by curl_easy_perform(3).29 30 RETURN VALUE31 CURLE_OK (0) means everything was ok, non-zero means an error occurred as
defines - see libcurl-errors(3). If the CUR‐32 LOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3) there will be a readable error message in the error buffer when non-zero is33 returned.34 35 EXAMPLE36 CURL *curl = curl_easy_init();37 if(curl) {38 CURLcode res;39 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");40 res = curl_easy_perform(curl);41 curl_easy_cleanup(curl);42 }43 44 SEE ALSO45 curl_easy_init(3), curl_easy_setopt(3), curl_multi_add_handle(3), curl_multi_perform(3), libcurl-errors(3),46 47 48 49 50 libcurl 7.7 5 Mar 2001 curl_easy_perform(3)

 

转载地址:http://jdasl.baihongyu.com/

你可能感兴趣的文章
Windows Azure 安全最佳实践 - 第 6 部分:Azure 服务如何扩展应用程序安全性
查看>>
50% 的财富 500 强企业使用 Windows Azure
查看>>
手机号码归属地查询免费api接口代码
查看>>
java8新特性使用
查看>>
“VS无法连接远程数据库”解决方案
查看>>
mysql查询查询条件越多速度越快_mysql优化(一)判断什么时候加索引
查看>>
php 下拉源码,PHP采集百度下拉框数据的脚本程序源码
查看>>
linux 删除 html文件,如何在 Linux 上恢复误删除的文件或目录
查看>>
linux qt默认编码方式是什么,QT编码方式
查看>>
c++线程中更新ui_大比拼 | 下一代高性能跨平台UI渲染引擎
查看>>
asp.net gridview 为什么只显示一行数据_针对mysql,数据库干货分享,值得收藏
查看>>
r 选取从小到大的数据_收藏|零基础学R之数据结构,一个学习R的理由足够
查看>>
向量图 正弦交流电路_立体几何大题——向量法(二面角)专题
查看>>
处于停机等非正常状态_工地停工,停机很久之后的挖掘机,重启前要检查什么...
查看>>
创建前缀一样的文件_8 个文件整理高级技巧,让你效率倍增
查看>>
mysql 配置程序_4 MySQL程序概述(包含mysql配置文件配置原理)-学习笔记
查看>>
ubuntu jdbc mysql_Ubuntu jsp平台使用JDBC来连接MySQL数据库
查看>>
qt 嵌入cmd窗口_MIL+QT实践教程三
查看>>
mysql的连接路径_Mysql 连接路径 url 参数解析
查看>>
mysql增量备份失败_mysql的增量备份
查看>>