Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to download multiple file parallelly xamarin ios plate form #91

Open
2 tasks done
vikassharma83021 opened this issue Jun 23, 2018 · 6 comments
Open
2 tasks done

Comments

@vikassharma83021
Copy link

vikassharma83021 commented Jun 23, 2018

I am using Xam.Plugins.DownloadManager plugin for file download in both plate form android and ios with xamarin. It is working fine on android plate form but on ios unable to download multiple files parallelly. anyone can help me ?

Expected behavior

I want to download multiple files parallely like in android.

Actual behavior

Now only one file can download at a time and next file downloading starts when previous completed.

Configuration

Platform:

  • iOS

Device:

  • Real device (i phone 7)
@SimonSimCity
Copy link
Owner

You can check what happens if increasing this factor:

private NSUrlSession createSession(NSUrlSessionConfiguration configuration, UrlSessionDownloadDelegate sessionDownloadDelegate) {
configuration.HttpMaximumConnectionsPerHost = 1;
return NSUrlSession.FromConfiguration(configuration, sessionDownloadDelegate, null);
}

Many sources I find on the internet highly encourage me to leave it at 1, either because the memory-overhead is quite high or because of some compatibility issues. https://robots.thoughtbot.com/a-simple-approach-to-thread-safe-networking-in-ios-apps#extending-urlsession-to-perform-requests-in-parallel

Please try it out and check if it works. If you want me to increase it please include other sources who state what the reason is not to increase it or how it could affect other factors of any kind.

https://stackoverflow.com/questions/39807300/how-does-the-maxconcurrentoperationcount-of-the-nsurlsession-delegatequeue-effec even points to another property which might be good to take ...

@vikassharma83021
Copy link
Author

Thanks for reply sir. how can i change configuration.HttpMaximumConnectionsPerHost in my installed package .

@SimonSimCity
Copy link
Owner

@vikassharma83021 you can create a fork of this repository, change the sample project so it includes what you want to test and then change the number in the file I showed you. This way you can test what side-effects it will have on your project or if it would work at all. (Some of the reports I found state that this helps nothing ...)

@vikassharma83021
Copy link
Author

but after change how can i add this to my project . because last time add this from nuget package manager

@vikassharma83021
Copy link
Author

hello please tell me about this

@SimonSimCity
Copy link
Owner

As I'm voluntarily working on this in my spare time I don't always have as much time as a paid support-service, answering every complex question within a guaranteed 24h.

I hope you've already found out about how to fork a project, add the individual projects of the solution of this repository into yours and adding them as reference to your platform-dependent projects.

Once you've done that you can just change the number and recompile the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants