Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
From Mårten Ekblad in mono-list:
I have created a client app that communicates with a web service that uses the Comet way of sending events to a client. To do that I start a "long-living" HttpWebRequest to the server. The server communicates back to the client by sending chunked content (Transfer-Encoding: chunked). Individual events are then transferred in chunks. The problem for me here is that Mono seems to wait for the connection to terminate or the timeout to happen before sending the chunks back to the consumer of HttpWebRequest. This is not the case in .Net. In .Net each chunk is reported back individually when they arrive.
This is the pseudo code I'm using:
1. HttpWebRequest req = WebRequest.Create( URL...);
3. stream = eventContext.WebRequest.EndGetRequestStream(...);
4. StreamWriter writer = new StreamWriter(stream);
9. HttpWebResponse resp = (HttpWebResponse) req.EndGetResponse(asynchronousResult);
10. responseStream = resp.GetResponseStream();
11. responseStream.BeginRead(eventContext.Buffer, 0, 20000, new AsyncCallback(DataReceived), eventContext);
12. In DataReceived I do responseStream.EndRead(asynchronousResult);
13. After that I arm the read again with responseStream.BeginRead(...);
In .Net DataReceived is called on each packet. In Mono it's called after 30 seconds (probably the timeout).
Is this the intended behavior with HttpWebRequest and chunked content? Is there another recommended way of dealing Comet style web services?
Created attachment 1509 [details]
Test that shows the difference between .NEt and Mono
Fixed in mono-2-10/bad8aa4 and master/864d354