title: HTTP Streaming in .Net
body: <p>I want to write a server which clients can consume.</p>
  
  <p>So the code at the client will look like something like below</p>
  
  <pre><code>req = (HttpWebRequest)WebRequest.CreateDefault(new Uri(FCookieLocation));
  HttpWebResponse resp1 = (HttpWebResponse)req.GetResponse();
  Stream stream = resp.GetResponseStream();
  </code></pre>
  
  <p>I want to then do something like</p>
  
  <pre><code>while (true)
  {
      byte b = stream.ReadByte();
  }
  </code></pre>
  
  <p>Eventually the server will run out of data and the client should know that the response has finished(Not sure ho to do that either.)</p>
  
  <p>The preference would be to have the server be used in conjunction with a CRUD service like WCF Data Service (or just a plain WCF service) as I do not want the client to access  URLs that look to distinct.</p>
  
  <p>Or do I have no choice but to write an independent server that is separate from my CRUD service to achieve this?</p>
  
  <p>Thanks</p>