Httpwebrequest requests are sent three times in a row. The third request will get stuck when responding to the object.

Source: Internet
Author: User

Today's test found this problem, which gave me a big jump and gave me a bit of suspicion about the httpwebrequest object. After continuous debugging, I found that requests are always sent three times in a row, the third time it gets the httpwebresponse object, it gets stuck.

At first, I thought it was a target site problem, but I did not test it later.

I thought myCodeThe problem is not detected.

I thought it was the impact of my entire project. I wrote a single console and found that it was still the case.

 

Finally, some people have encountered the same situation as me. In fact, this is the case. After each interaction is completed, you can call the abort method of the httpwebrequest object before the next request starts...

I actually talked to others about this, because this disconnection I think is a problem with the Web server. The web server will automatically shut down if you do not want to connect to the other party, in this case, I ignored the connection. I don't know how to maintain the connection at the bottom layer of C ..

 

Solve the problem ..

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.