Git Product home page Git Product logo

Comments (21)

bezzad avatar bezzad commented on May 18, 2024

Hi @fengyuan213,

Thanks for reporting the issue.
I check your download URL and sample, but that's work correctly and I can download your files successfully! Of course, this link has some server-side problems such as disconnecting some times and I tested by some downloaders like IDM and all of them have this problem when downloading from.

And I check this link and our project works exactly with the ReadAsync command instead of the ReadToEnd, But I change some request options to improve the stability and after the test I released a new version.

from downloader.

bezzad avatar bezzad commented on May 18, 2024

@fengyuan213 I released a new version 1.0.9, please test that.

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Hello, I tested with the new version again just now. .The good news is that It can download succeed sometimes with parallel downloads option changed to false, however, When I try to download the file in parallel. Then it throws the same error at the download chunks method. However, I don't really think there is any server-side issues because the link I use to test download is from a known CDN network provider so... I checked with my link through IDM multi-thread downloading and it just works perfectly without any pieces of the issue. I have no idea why that is happening. Maybe it an idea to automatically retry to download the same chunk data if this exception occurred to try to avoid the issue.
image

Also, downloading sometimes stack. From the title bar of the console, it is able to see it's on 29.671% progress of downloading. The things are the progress never gets changed even for half an hour. Maybe regularly check if the download thread still alive...
image

Please help

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Update, the ParallelDownload = false option could let me download successful but it only for some time. There is a chance like 1/3 download failed and thows same exception as before. See picture belovw
image

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

By the way, I am using WinForm in the Console Application by setting STAThread Attribute. Is that the case?

from downloader.

bezzad avatar bezzad commented on May 18, 2024

@fengyuan213 No, your application is fine and no problem. My downloader library has no dependency on your or any other project.
In this case, I have to work harder to find out why. If you have any information about this problem, be sure to mention it here.
Thanks

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Ok , Please update the version so I can test it.

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Today, I had another download issue with the same error message : Unable to read data from the transport connection: the connection was closed
image

The Client Instance hasn't disposed of it when downloading data.
It is very strange in this case because this function was worked perfectly.....The network section seems to be less stability when I changed the project to STAThread....

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Hello there, I have a super super good news, After I testing between net core and framework for lots of time. I figured it out why. The solution is so simple. When downloading chunkes, the downloader catches webexception and the following.
e.Source == "System.Net.Http" ||
e.Source == "System.Net.Sockets" ||
e.Source == "System.Net.Security" ||
e.InnerException is SocketException)
In the Framework I don't know how but "Unable to read data from the transport connection " is a part of IOException Instead of any of them above. Simplify just append "e is IOException" and problem solved. Please share your throughts becuase I am not too sure if it is a good way but it solved my problem.

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

image

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Also, The CacheInMemory =False mode is not working which means all downloads are forced to cacheinmemory

from downloader.

bezzad avatar bezzad commented on May 18, 2024

@fengyuan213 Thank you for your follow-up. The IOException is very general and I can't catch that because maybe the exception has been caused for many reasons.
I have made changes to the source that I hope will solve your problems. You can see these changes in version 1.2.

from downloader.

bezzad avatar bezzad commented on May 18, 2024

New version (1.2) released. Please test with that to sure solved this issue or not.
The caching mode also fixed in this version.

from downloader.

bezzad avatar bezzad commented on May 18, 2024

@fengyuan213 have you tested this issue in the new version?

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Hello,
I tested the new version today. It is great to have a new feature like speed limit. However, the problem still exist......
image

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Hello, I think it is kinds of useful update...The post above uses Downloader.Sample's default configuration with KeepAlive=false
The error below occurs when I set to the KeepAlive opt = true.
Configuration:
image

Stacktrace:
" at System.IO.Stream.BeginReadInternal(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state, Boolean serializeAsynchronously)\r\n at System.IO.Stream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)\r\n at System.IO.Stream.<>c.b__43_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)\r\n at System.Threading.Tasks.TaskFactory1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func5 beginMethod, Func`3 endMethod)\r\n at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)\r\n at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)\r\n at Downloader.DownloadService.d__45.MoveNext() in C:\Users\Fengyuan\source\repos\Downloader\src\Downloader\DownloadService.cs:line 285\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at Downloader.DownloadService.d__44.MoveNext() in C:\Users\Fengyuan\source\repos\Downloader\src\Downloader\DownloadService.cs:line 228"
image

from downloader.

bezzad avatar bezzad commented on May 18, 2024

@fengyuan213 some servers does not support KeepAlive=true option, so I set default value to false.
In the first error, every time I check that, I could see no error! Is this the download link?
‍‍"http://resources.downloads.pokecity.club/2020.rar"

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

Yep......

from downloader.

fengyuan213 avatar fengyuan213 commented on May 18, 2024

The link above u might not able to download in your area.. try this one:
http://test.download.pokecity.club/2020.rar

from downloader.

bezzad avatar bezzad commented on May 18, 2024

@fengyuan213 I released the new version v1.5.0. Please check this version. And if you have still this problem, please send me a complete exception data as TEXT or JSON to check exception source and types.
Thanks

from downloader.

bezzad avatar bezzad commented on May 18, 2024

@fengyuan213 Was this problem solved with the new version?

from downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.