直白叙述一下multi interface优于easy interface的地方

来源:互联网 发布:司马懿和诸葛亮知乎 编辑:程序博客网 时间:2024/04/29 05:25

The multi interface offers several abilities that the easy interface doesn't. They are mainly:

1. Enable a "pull" interface. The application that uses libcurl decides where and when to ask libcurl to get/send data.

2. Enable multiple simultaneous transfers in the same thread without making it complicated for the application.

3. Enable the application to wait for action on its own file descriptors and curl's file descriptors simultaneous easily.

4. Enable event-based handling and scaling transfers up to and beyond thousands of parallel connections.

简单描述:

下面对于在C项目中使用mutil libcurl 进行一种简单的描述。

1、能够将接口“拉过来”:应用可以决定何时何地访问并使用libcurl接收或者时发送数据。

2、能够方便地在应用的同一个线程中同时进行传输任务。

3、能够使得应用同时方便地等待自己的文件描述符和curl库的文件描述符。

4、能够在高达甚至超过上千个并行链接时基于事件处理和管理传输任务。


另外读文档时发现有这么一句话(应该是指在multi_perforn之后仍旧可以向multi handle 中添加easy handle):

在任何时候都可以向multi handle 中添加 easy handle ,即使正在进行其他的下载任务。



第一次写博客,也是刚接触curl库,很多知识还是不足,希望大家多多交流、指正。

0 0