NSURLSession Bandwidth Limit

Is there a way to limit bandwidth in NSURLSession ?

I am making a file sync for macOS like Dropbox/GoogleDrive/pCloud and everyone has bandwidth limit options, but I'm not sure how to configure NSURLSession to comply with bandwidth limit.

0
nsurlsession macos bandwidth-throttling
source share
1 answer

If Apple hasn’t added anything recently, NSURLSession doesn’t provide any bandwidth limits. The only thing I know is:

  • Use the lower-level APIs that allow you to provide your own sockets and then throttle the data rate at the TCP socket level.
  • Provide a web proxy in the application and use it for all outgoing requests. Configure a proxy server to limit the bandwidth of all requests passing through it.
+1
source share

All Articles