Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
334 views
in Technique[技术] by (71.8m points)

ios - Maximize the number of simultaneous http-downloads

I'am trying to perform as many as possible simultaneous http-downloads an IPad2 ( ios6.0 ). This is pure for testing what is possible on this device. Even not interested in GUI performance ( not important if it doesn't respond )

I've created a special HTTP-server that sends for x minutes data to the client. The data received is of no importance. I just measure the speed an how many concurrent downloads. I've implemented 2 different ways of scheduling 12 HTTP-requests.

NSOperation

One is done by using NSOperation objects in a Queue and set the NSOperationQueueDefaultMaxConcurrentOperationCount on 12

NSThread

The second implementation is by creating 12 NSThreads that perform a synchro http-request.

The requests are all sent to the same destination IP.

Observation

What I observe is that in both cases the 6th to 12th request get a TimeOut ( errorcode -1001 ). If 1 put the timeout-value to 80.0 seconds, I see that the 6th download starts when the 1st is done.

Questions

  • Is there in IOS a limit on how many concurrent downloads?
  • Is there an other way to perform these concurrent downloads ?
  • Is there a way to bind a thread to a core ( so that it doesn't get an interrupt, like cpuaffinity in C++ ) or thread priority
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can have maximum of 5 simultaneous connections to the same server. It's an iOS fixed limit and it's probably because of some http protocol constraints. You can read a bit more info here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...