Parts of asynchronous httpwebrequest

There are many parts related to httpwebrequest that can go asynchronously. I remember reading a question here on this topic, but I can no longer find it. So I ask the question again. Which of the following has the greatest impact on the dollar (so to speak).

BeginGetRequestStream / EndGetRequestStream

BeginWrite / EndWrite

BeginGetResponse / EndGetResponse

BeginRead / EndRead

I understand that BeginGetResponse must be paired with BeginGetRequestStream. Therefore, there is no need to repeat this fact.

From the research I did, it seems that BeginRead / EndRead can have the greatest potential. It was a little shocking. It seems that EndGetResponse is returning rather quickly and there is a significant delay after the "first contact" and any real data coming into read. I'm sure I get some headers right away, and then a long delay, followed by the data I want.

I think my real question is: am I something wrong with BeginGetResponse or is a really valuable player here BeginRead?

As always, thanks in advance.

+3
source share
1 answer

EndGetResposnse (, , GetResponse) . .

, . , ( - ) .

, , . - asynch, httpwebrequest.

, , ienumerable yield, ( , yield LINQ). , asych, .

+2

Source: https://habr.com/ru/post/1761176/


All Articles