如何快速恢复文件下载 [英] How to quickly Resume file download

查看:91
本文介绍了如何快速恢复文件下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用MFC开发文件下载实用程序.该实用程序使用CHttpFile类下载5096bytes的块中的文件.有时由于网络中断,下载将失败.但是,获得网络连接后,我希望该实用程序从中断的地方恢复下载.该实用程序知道它先前已下载了多少字节,并在继续下载时调用Seek()方法以重置指针.但是问题出在调用Seek()方法然后调用Read()方法要花很多时间才能返回.如果先前下载的文件大约为20MB,则返回时间会更长,并且随着文件大小的增加,返回时间也会成比例地增加.任何想法如何解决这个问题?

注意:恢复下载后,我将打开一个新的Internet会话.这可能是罪魁祸首吗?

在此先感谢...

Hi All,

I am developing a file download utility using MFC. This utilty uses the CHttpFile class to download the file in chunks of 5096bytes. Sometimes due to network outage the download fails. However after gaining network connectivity I want the utility to resume download from where it was interrupted. The utility knows how many bytes it has downloaded previously and calls the Seek() method to reset the pointer while resuming download. But the issue is after calling Seek() method and then calling the Read() method takes a lot of time to return. The return time is longer if the file downloaded previously is around 20MB approx and it increases proportionally as the file size increases. Any idea how to resolve this??

NOTE: Upon resuming download, I open a new internet session. Could this be the culprit?

Thanks in advance...

推荐答案

关注:
暂停和播放在协议级别恢复. (您可以使用任何语言来实现它) [
Follow:
Pause & Resume at Protocol level. (You can implement it in any language)[^]


这篇关于如何快速恢复文件下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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