文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > 计算机软件及应用 > 基于SOCKET的多线程下载工具的开发
侵权投诉

基于SOCKET的多线程下载工具的开发

2011年8月第8期

电子测试

ELECTRONIC TEST

Aug.2011No.8

基于SOCKET的多线程下载工具的开发

基于SOCKET的多线程下载工具的开发

周学威,闫鑫,赵榉云,杨薇

(中北大学 仪器科学与动态测试教育部重点实验室,山西 太原 030051)

摘要:在Windows编程中,为了提高代码的时、空效率,广泛采取多线程技术。本文以多线程技术的应用为研究背景,实现了多线程的一个应用:多线程文件下载。该下载工具以VC++6.0为开发平台,利用Windows 套接字函数进行网络编程,实现了基于HTTP协议的文件下载过程,并通过创建和编写线程函数实现了文件的多线程下载工具的开发。利用该下载工具可以对网上的文档、图片、歌曲等各种文件实现多线程下载。经测试表明,该下载工具使文件的下载速率得到了有效提高。关键词:多线程;HTTP协议;Windows套接字函数中图分类号: TN915.85

文献标识码: A

Development of multi-thread downlodeing tool

based on socket

Zhou Xuewei, Yan Xin, Zhao Juyun, Yang Wei

(Key Laboratory of Instrumentation Science & Dynamic Measurement (North University of China),

Ministry of Education, Taiyuan 030051, China)

Abstract: In order to improve code’s efficiency both in time and space, Multi-thread technology widely used on Windows programs. This thesis’s background was the apply of the multithreading technology, realize an application of multithreading technology: The Multi-Thread download file . This tool used VC++6.0 as the development space and windows socket function to finish the process, realizing the file download based on Hyper Text Transfer Protocal, And by creating and writing thread function realize the file multi-thread downloading tools development.To avail these multithreading download instrument could download the different kinds of file by multithreading in net, such as the documents、pictures、songs and so on .The test shows that the download tools make file download speed effectively improved.

Keywords: multi-thread; hyper text transfer protocal; Windows socket function

0 引言

技术、甚至能支持多少个下载线程都成了人们评测下载软

多线程就是允许单个程序创建多个并行执行的线程来完成各自的任务,它在多任务和实时处理等方面具有重要意义,特别是在网络应用程序中,可以提高带宽利用率和程序反应速度。为了达到下载大型网站的目的,在编写离线浏览软件的过程中,需要下载大量的Web文件,其中一个技术要点就是多线程下载问题。是否具有“多线程下载”

[1]

件的要素[2]。本文以SOCKET技术为依托,基于VC++6.0环境,采用HTTP协议,通过编写客户端应用程序,对文件的多线程下载进行了设计与实现。

1 设计思路

多线程下载的前提是网络的连通和通信软件与协议

第1页

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email