WebClient in Monotouch does not finish file downloads

荒凉一梦 提交于 2019-12-10 12:23:30

问题


I am finishing the development of an application using monotouch that downloads video files. Something like the TEDTalks app. But I am having the problem that the WebClient.DownloadFileAsync doesn't finish downloading the files reliably, but every so often hangs at some point and doesn't continue downloading the file. The problem is worst with larger files, although I have monitored the memory usage of the app and is not affected by size of the file being downloaded. The filestream that I used to write the file locally is flushed regularly. I tried rewriting the class to use a HttpWebRequest with the same results.

Any ideas would be appreciated, thanks.


回答1:


MonoTouch 4.2 has many bug fixes including quite a few related to WebClient and HttpWebRequest (one of them very similar to your description). You should definitively update and try the latest 4.2.2. If it still does not work like expected please fill a bug report at http://bugzilla.xamarin.com and include a test test.




回答2:


Are you on the latest MT 4.0.3? 4.0 - 4.0.2 had some networking problems



来源:https://stackoverflow.com/questions/6282278/webclient-in-monotouch-does-not-finish-file-downloads

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!