[Mono-list] System.Net.WebResponse.GetResponseStream - stream.ReadByte() blocks until request ends

Mike Hadlow mike at suteki.co.uk
Fri Aug 3 13:31:04 UTC 2012


I'm trying to write a client for the twitter streaming API, a 'comet' style
service that returns chunks of JSON over an open HTTP connection.
Unfortunately the response stream doesn't return anything until the
response ends, which it never does.

My code looks a bit like this...

using(var stream = response.GetResponseStream)
    int byteAsInt;
    while ((byteAsInt = stream.ReadByte()) != -1)
        // blocks on previous line rather than streaming bytes as they
arrive :(

Is this a known bug?

Many thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20120803/ae2503ca/attachment.html>

More information about the Mono-list mailing list