Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLConnection/NSURLDownload max simultaneous connections



Dear list

I'm developing an application that, under certain conditions, spawns quite a few NSURLDownload for several different files/urls at several different servers.

While checking what was happening under the hood, i discovered that i can never get more than 4 simultaneous connections. If i spawn 20, (NSLog shows they were inited and started) only 4 open immediately. After that, a new is started everytime an existing one is finished.

I have no queuing mechanism!

Does anyone have a clue as to how i can circumvent this limitation (if, indeed, it is a limitation)?

- sample flow
: instantiate 20 NSURLDownload (they're started with the init method so no further action is needed)
: for each, log instantiation result (nil? always false)
: check Activity Monitor for open files/pipes. Only 4 sockets at a time
: NSLog each downloadDidFinish and downloadDidReceiveResponse
: Everytime a downloadDidFinish occurs, a new downloadDidReceiveResponse also occurs until all are finished
: simple debug action taken:
: increment downloadCount variable at each downloadDidReceiveResponse
: decrement downloadCount variable at each downloadDidFinish/ FailWithError
: evey NSLog of downloadCount reads 4 until less than 4 downloads are left to complete


Cheers

Filipe Varela


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.