并行获取文件 [英] Parallel fetching of files

查看:13
本文介绍了并行获取文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了下载文件,我创建了一个 urlopen 对象(urllib2 类)并分块读取.

In order to download files, I'm creating a urlopen object (urllib2 class) and reading it in chunks.

我想多次连接到服务器并在六个不同的会话中下载文件.这样做,下载速度应该会更快.许多下载管理器都有此功能.

I would like to connect to the server several times and download the file in six different sessions. Doing that, the download speed should get faster. Many download managers have this feature.

我想过在每个会话中指定我想要下载的文件部分,并以某种方式同时处理所有会话.我不确定如何实现这一目标.

I thought about specifying the part of file i would like to download in each session, and somehow process all the sessions in the same time. I'm not sure how I can achieve this.

推荐答案

听起来您想使用 可用的 HTTP 范围.

edit 更新了指向 w3.org 存储的 RFC 的链接

edit Updated link to point to the w3.org stored RFC

这篇关于并行获取文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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