C# - How to read a continuous stream of XML over HTTP

后端 未结 2 711
予麋鹿
予麋鹿 2020-12-14 23:30

I am trying to figure out the best way to consume a continuous stream of XML data from a service that is sending the data as a \"constant\" feed over HTTP.

I was con

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 23:55

    Should be able to do it fairly easily. You'll need to get the response stream by calling Response.GetResponseStream() and then use the async ResponseStream.BeginRead() in a loop.

    There is no Timeout setting on the Response but if you're consistently getting sent data then it should be fine.

提交回复
热议问题