SSE Client request which does not terminate c#

2019-06-01 03:29发布

I am using C# to connect to a web service. I am need to send a GET request to monitor some transactions, and the web service will be sending the transactions to me continuously without breaking the connection. The web service provider said I need to connect to them with a http library that supports SSE.

I have tried using HttpWebRequest and HttpClient to send request and receive response, but both of my attempt failed. I don't get response from the web service.

My question is: The web service will send the transactions to me without breaking the connection, but how do I keep the connection up? Do I have to set up a socket for listen after I send the GET request?

Thank you, kab

1条回答
何必那么认真
2楼-- · 2019-06-01 03:40

I have the issue resolved. So basically, I send a httpclient request, then I tie the response stream to an event handler, so whenever there is data on the stream, the event will be raised.

Thanks for all of your inputs. kab

查看更多
登录 后发表回答