已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Libtorrent技术分享,主要内容,Libtorrent简介如何使用LibtorrentLibtorrent代码分析,Libtorrent简介,特性,基于C+编写支持windows,Linux/Unix 系统开源支持绝大部分BT特性代码风格良好帮助文档丰富高效(网络IO,磁盘IO,内存),作者,如何使用libtorrent,编译,编译boost编译open ssl编译libtorrent,Hello word,int main(int argc, char* argv)using namespace libtorrent;session s;error_code ec;s.listen_on(std:make_pair(6881, 6889), ec);add_torrent_params p;p.save_path = D:我的资料库Downloads;p.ti = new torrent_info(D :Spark_Setup.exe.torrent, ec);s.add_torrent(p, ec);/ wait for the user to endchar a;scanf(%cn, &a);return 0;,API Overview,The interface of libtorrent consists of a few classes. The main class is thesession, it contains the main loop that serves all torrents.The basic usage is as follows:construct a sessionload session state from settings file (seeload_state() save_state()start extensions (seeadd_extension().start DHT, LSD, UPnP, NAT-PMP etc (seestart_dht() stop_dht() set_dht_settings() dht_state() is_dht_running()start_lsd() stop_lsd(),start_upnp() stop_upnp()andstart_natpmp() stop_natpmp()parse .torrent-files and add them to the session (seebdecode() bencode()andasync_add_torrent() add_torrent(),API Overview,main loop (seesession)query the torrent_handles for progress (seetorrent_handle)query the session for informationadd and remove torrents from the session at run-timesave resume data for all torrent_handles (optional, seesave_resume_data()save session state (seeload_state() save_state()destruct session objectEach class and function is des,Details,参考使用手册,Libtorrent代码分析,线程模型,主线程:Session线程,处理设置,查询等业务文件线程:disk_io_thread.网络线程:io_service,定义如下:typedef boost:asio:io_service io_service;在windows平台上通过完成端口实现,线程模型,typedef boost:asio:io_service,线程模型,disk_io_thread与chrome的线程模
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年棉花加工合作协议
- 妇幼保健工作中存在的问题及建议
- 2025年碳中和目标下的减排项目可行性研究报告及总结分析
- 2025年教育科技行业在线教育课程内容优化研究报告及未来发展趋势
- 2025年计算机体系结构专升本专项训练试卷(含答案)
- 2025年电池存储系统研发与应用可行性研究报告及总结分析
- 2025年碳中和项目规划可行性研究报告及总结分析
- 2025年连锁餐饮商品电子价签改造合同协议
- 云南省专升本试卷真题及答案
- 2025年基因检测市场拓展可行性研究报告及总结分析
- 房屋过户子女代签委托书
- 网络安全培训内容课件
- GB/T 6433-2025饲料中粗脂肪的测定
- 《霍乱防治知识培训》课件
- 室内装修施工过程中的安全防护考核试卷
- 音乐学专业大学生职业生涯发展
- 2024年05月北京中国人民银行金融基础数据中心实习招考笔试历年参考题库附带答案详解
- 【MOOC期末】《英美文学里的生态》(北京林业大学)期末中国大学慕课MOOC答案
- 能源管理系统投标技术文件
- 2023年沧州市中心医院选聘笔试真题
- 旅游管理类专业职业生涯规划
评论
0/150
提交评论