ā I'm trying to download a link in 4 chunks via HttpClient but it keeps breaking.
Link to my GitRepository https://github.com/Error1OH1/FileDownloader
I've been trying to download in 4 chunks but I can't seem to get the file to download in 4 chunks properly it loops through but always ends up only being a quarter of the download, and this new updated code just breaks but downloads a 0 KB file.
GitHub
GitHub - Error1OH1/FileDownloader
Contribute to Error1OH1/FileDownloader development by creating an account on GitHub.
62 Replies
makes it easier to read in discord
couldnt get it to work yet but
I did see this
i used a snippet of ur code to show u
I put answers with comments in that pull request
š
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I am okay with rewriting it for the sake of learning but could you explain why first
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Oh I used that because I was having a hard time understanding how to use httpclient and was basing it off a friends
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
What do you mean
It's a console application if that is what you mean
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I'm still new to programming
Does this cause corruption if I do?
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
OH I THINK I GET WHAT YOU MEAN
IN MY CLASS USE THE SAME FOR ALL THE METHODS
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
SO CALL IT OUTSIDE OF THE METHODS AS PUBLIC USE
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I was trying to create an HttpClient Library class so I could use it for future projects easier
Is that what broke it?
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Also, I am far from knowledgeable with async I barely understand how it's working in my use.
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Also couldn't I do it non asynchronous via .result and .wait();?
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
TLDR on
async
/await
:
* every .net API that is suffixed with Async
(eg: .Read()
and .ReadAsync()
) => use the Async
version
* if the API name ends with Async
=> await
it
* if the API returns a Task
=> await
it
* if you have to await
in a method:
* that method must have the async
keyword (you could even suffix your function name with Async
, up to you)
* if it was returning T
(eg:string
) => it should now return Task<T>
(eg: Task<string>
)
* APIs to ban and associated fix:
That is extremely helpful
Thank you
What API?
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I have a friend who has already worked in this field and is pretty good at coding and he had me use it
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
That's definitely why
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I've been kind of using him as a roadmap on what I should do next and since I am kind of slow at learning he probably just trying to make it easier
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Not literally a roadmap
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I just ask for project ideas
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
What experience have you had with C#?
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Oh shit since I was born
š¤£
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
That's awesome dude
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I'm assuming you aren't American?
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
You keep saying these
Instead of "This"
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
or it could be these kind(s)
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I feel like we are diverting from the topic lmao
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I'm going to rewrite the code with what you've provided
Dude if one word and plurals are all you are messing up on it's nothing to worry about
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
People on Discord don't necessarily talk to each other like they would in real life and put out more unnecessary flare to what they say, so it makes it more difficult. Even English users have difficulty understanding each other on online applications.
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
I've only been coding for 3 months so it was more of just an attempt
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
Dude
What
I didn't do this
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
It was more than likely systematically put their based on my code
Unknown Userā¢2y ago
Message Not Public
Sign In & Join Server To View
The goal is for downloading faster again I am still new and 4 was just the number I chose
They are meant to download in parallel
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.