取消libcurl简单句柄 [英] Cancel libcurl easy handle

查看:692
本文介绍了取消libcurl简单句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个简单的方法来取消curl_easy_perform从另一个线程?

Is there an easy way to cancel a curl_easy_perform from another thread?

推荐答案

你必须使用回调函数/ read / progress)来执行取消。其他线程需要设置一个标志,回调函数检查标志并返回正确的值来取消操作。

You have to use the callback functions (write/read/progress) to perform the cancel. The other thread needs to set a flag and the callback function checks the flag and returns the proper value to cancel the operation.

这篇关于取消libcurl简单句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆