I am wondering how I will read the persistent connection with HttpWebRequest and HttpWebResponse. The problem is that the GetResponseStream () function waits for the connection to the server to complete before returning.
Is there an easy way to read a cometary connection? An example that does not work.
// get the response stream Stream resStream = response.GetResponseStream(); string tempString = null; int count = 0; do { // fill our buffer count = resStream.Read(buf, 0, buf.Length); // as long as we read something we want to print it if (count != 0) { tempString = Encoding.ASCII.GetString(buf, 0, count); Debug.Write(tempString); } } while (true); // any more data to read?
Kosaki
source share