Connect to URL and listen indefinitely

I am trying to write a C# app that will connect to an HTTP endpoint and listen for JSON messages that come to that endpoint then deserialize them. I had this working, but the connection would end after 60 seconds after the latest message came through.

I was using HttpWebRequest to connect to the URL, then GetResponseStream to read the stream and process.

I am really just looking for general guidance on how to do this, what is the best path. This is trivial in Javascript using Server Sent Events, but am having a hard time getting to work in C#. Any help is appreciated.

submitted by /u/jdh7190
[link] [comments]

Leave a Reply