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

Use HttpClient instead of HttpWebRequest #22

Open
johanneszab opened this issue Feb 3, 2019 · 5 comments
Open

Use HttpClient instead of HttpWebRequest #22

johanneszab opened this issue Feb 3, 2019 · 5 comments
Labels
architecture Code base enhancements necessary for future development bigger project Estimated level of difficulty help wanted Extra attention is needed

Comments

@johanneszab
Copy link
Contributor

The code is full with error prone exception handling caused by the HttpWebRequest api. Additionally the async variant of the GetReposone method, GetResponseAsync() is broken as it never timeouts if the underlying connection drops and lead me to implement the TaskTimeout Extension.

From the MSDN docs (the GetResponeAsync() method uses BeginGetResponse() internally (thanks for not telling MS!)):

The Timeout property has no effect on asynchronous requests made with the BeginGetResponse or BeginGetRequestStream method.

The newer interface HttpClient was designed with async in mind and should be used instead. It also doesn't use Exceptions to handle non-successful web responses (i.e. status codes 300-499).

See also these issues for more: TumblThree/#116, TumblThree/#214.

@johanneszab johanneszab added the architecture Code base enhancements necessary for future development label Feb 3, 2019
@elipriaulx elipriaulx added this to the Renew Stability milestone Feb 3, 2019
@yfdyh000
Copy link
Collaborator

yfdyh000 commented May 5, 2020

Work in progress, but now blocked in make globalized HttpClient and cookieContainer, because I am not a C# expert.
My goal is HTTP/2.

See yfdyh000@6ca9537. Help wanted.

New efforts are underway.

@yfdyh000
Copy link
Collaborator

yfdyh000 commented May 9, 2020

https://github.com/yfdyh000/TumblThree/tree/httpClient-wip1 (still going on locally)
My work, now it seems to work, but a lot of exceptions handling needs to be rewritten, as well as testing and repairing, this is a big project...
Peers still care about this?

@thomas694
Copy link
Contributor

Thanks for your work!
Sadly, after over one year after the issue had been opened, no one still monitored it and saw your efforts. I don't expect that you are still encouraged. So maybe when I have enough time, I'll make a copy of your branch and try to update it to the latest code version to see how it fits and can be used as a good starting point for further continuation.

@yfdyh000
Copy link
Collaborator

yfdyh000 commented Oct 9, 2020

Thanks for your work!
Sadly, after over one year after the issue had been opened, no one still monitored it and saw your efforts. I don't expect that you are still encouraged. So maybe when I have enough time, I'll make a copy of your branch and try to update it to the latest code version to see how it fits and can be used as a good starting point for further continuation.

Thank you for your answer. I have suspended work on it.

@thomas694
Copy link
Contributor

Let me know, also later, if you like to resume. If not, it's understandable.

@thomas694 thomas694 added bigger project Estimated level of difficulty help wanted Extra attention is needed labels Nov 1, 2020
@thomas694 thomas694 removed this from the Renew Stability milestone Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Code base enhancements necessary for future development bigger project Estimated level of difficulty help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants