Linux_http_download
所属分类:网络编程
开发工具:Unix_Linux
文件大小:18KB
下载次数:147
上传日期:2007-05-20 12:11:27
上 传 者:
godown
说明: 下载程序,多线程下载,断点续传.
目前只能下http,而ftp等都还没有实现,详细请看readme文件
(download, multi-threaded download, HTTP. Currently only under http, and ftp still not achieved, see the readme file)
文件列表:
ants (0, 2006-08-12)
ants\bin (0, 2006-08-12)
ants\bin\ants (16913, 2006-08-12)
ants\source (0, 2006-08-12)
ants\source\ants.c (5281, 2006-08-12)
ants\source\ants.h (968, 2006-08-12)
ants\source\config.h (70, 2006-07-30)
ants\source\download.c (1081, 2006-08-12)
ants\source\host.c (3454, 2006-08-12)
ants\source\host.h (510, 2006-08-04)
ants\source\http.c (5055, 2006-08-12)
ants\source\http.h (211, 2006-07-31)
ants\source\Makefile (319, 2006-08-12)
ants\source\skip_lock.c (273, 2006-07-30)
ants\source\skip_lock.h (175, 2006-07-30)
ants\source\wait_read.h (350, 2006-08-04)
在家等工作消息,闲的无聊,写了个下载程序,多线程下载,断点续传.
目前只能下http,而ftp等都还没有实现,写的玩的,不要笑我.
目前有些bug,希望大家给我改正.
目前统计下载信息显示下载速度是错误的,但下载完成比率是对的,
不知道为什么?告诉我!谢谢.
说明:
线程同步没有使用系统提供的锁,因为我觉得他可能是阻塞的,在一个时刻
我只需要有一个线程统计信息,没必要等待(其实是我不会用).所以自己仿造
linux的spin-lock写了个 skip-lock,发现有线程在统计,立即退出.
下载数据包不直接写,先写到缓冲,写满再写到硬盘.
安装
进入目录 make 就够了.
系统默认下载位置是/usr/src/,要修改可以在download.c中改后编译
实现断点续传的临时文件以.nat结尾,在同一目录.
用法:
运行ants
根据提示输入下载地址,只能是http
根据提示输入引用地址(有的网站要,例如华军软件圆)如果没有就随便输入1-3个字符
根据提示输入线程个数,如不合理,会自动修改.
很不完善,不过好象速度还行.哈哈.
近期下载者:
相关文件:
收藏者: