Limiting upload speed
Limiting upload speed
- Subject: Limiting upload speed
- From: patrick machielse <email@hidden>
- Date: Fri, 11 Jan 2008 00:48:58 +0100
I'm writing an application that potentially uploads a LOT of data to a
remote server (think GB). This upload activity should not impair the
normal usage of (network) applications (too much), and so I'm looking
for a way to limit the upload speed of my program.
To upload the data I create HTTP POST forms in NSData which I send
using NSURLConnection / NSURLRequest. It has been suggested to me that
I can use -[NSMutableURLRequest setHTTPBodyStream:] and use my own
custom NSInputStream subclass to control the rate at which bytes are
sent. However, it seems that subclassing NSInputStream (used in
conjunction with NSURLConnection?) are broken in Mac OS X 10.4 (and
10.5 in my experience).
<http://lists.apple.com/archives/macnetworkprog/2007/May/msg00053.html>
Using the a standard NSInputStream and registering as delegate doesn't
work either, because the URL request assumes that role.
- Can I make this work in Cocoa? (maybe by subclassing
NSMutableURLRequest instead...)
- Should I use some lower level framework to achieve my goal?
- Should I take a completely different approach to the problem?
TIA,
patrick machielse
Hieper Software
_______________________________________________
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:
This email sent to email@hidden