多个 NSURLConnection 是否会导致性能延迟?
我做了一个多文件下载器。 我使用 NSOperationQueue 实现了 NSURLConnection。
NSOpetationQueue 有很多 NSURLConnection 操作。
并且,将MaxConcurrentOperationCount设置为10。
我以为我的代码是正确的,但是运行项目后,它是错误的。 发生了一些连接错误。 文件网址是正确的。并完成文件下载。 但下载文件时,出现“超时”错误。
事情是如此严重。 我测试了8个文件,总大小只有3M。 但总下载时间是2分钟~!!!
下载一个文件只需几秒钟。 (2~3秒) 但是多文件下载会出现很多负担! (2分钟)
我不知道为什么...... 有谁知道是什么原因吗?
I made a multi files downloader.
I implemented NSURLConnection using NSOperationQueue.
NSOpetationQueue has many NSURLConnection operations.
and, set MaxConcurrentOperationCount to 10.
I thought my code is right, But after run the project, it was wrong.
there are some connection error has occured.
files url were right. and file download was completed.
but downloading files, occur "timed out" error.
It is so serious.
I tested it with 8 files, and those total size is only 3M.
But total download time is 2minutes ~!!!
one file download spends only a few second. (2~3 s)
but multi files download occur many overburden!! (2 minutes)
I don't know why it is...
Do Anyone know what reason is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,我的错~!!!
这不是问题。
我检查了网络速度。并且文件通过模拟器存在于目录中。
因此,这取决于网络速度!
一个文件,多个文件都是相同的结果。
我很抱歉问错问题了。
Ah, my mistake~!!!
It is not problem.
I checked network speed. and file exist in directory via simulator.
As a result, It depends on network speed !
one file, multi file is the same result.
I'm sorry about wrong question.