[Mono-devel-list] Trouble with HttpWebResponse

Peter Magnusson kmpm_se at msn.com
Mon Mar 3 14:06:49 EST 2003


It hangs in System.IO.StreamReader.ReadToEnd(). It runs into a infinite loop 
but I can break it with ^c.
I tried earlier to change the .ReadToEnd method (there is a while statement 
that i changed to if) and then it worked but some guy at ximian (i filed a 
bug #38976) thought that the error was elsewhere.



>From: "Reggie Burnett" <rykr at bellsouth.net>
>To: "'Peter Magnusson'" 
><kmpm_se at msn.com>,<mono-devel-list at lists.ximian.com>
>Subject: RE: [Mono-devel-list] Trouble with HttpWebResponse
>Date: Mon, 3 Mar 2003 13:00:50 -0600
>
>What happens?  Does it ready anything?  Throw an exception?
>
> > -----Original Message-----
> > From: mono-devel-list-admin at lists.ximian.com [mailto:mono-devel-list-
> > admin at lists.ximian.com] On Behalf Of Peter Magnusson
> > Sent: Monday, March 03, 2003 12:54 PM
> > To: mono-devel-list at lists.ximian.com
> > Subject: [Mono-devel-list] Trouble with HttpWebResponse
> >
> > At first I thougt I had some trouble with
>System.IO.StreamReader.ReadToEnd
> > but it seems that there is trouble elsewhere..
> > The test described below works fine with Microsoft .NET SDK and the
>csc
> > compiler but it doesn't work with mono, at least not in SuSE 8.1 Pro.
> >
> > The failing configurationen uses
> > SuSE Linux 8.1 Pro
> > Mono-0.21, mcs-0.21
> > Compaq Evo N800c (P4 1.7 MHz, 392 MB Ram)
> >
> > The working configuration uses
> > Windows XP Pro SP1
> > Visual Studio .NET 2002 Ent. Arc.
> > (mono isn't installed in windows)
> > Compaq Evo N800c (P4 1.7 MHz, 392 MB Ram)
> >
> >
> > ===== Test Begin ======
> > using System;
> > using System.IO;
> > using System.Text;
> > using System.Net;
> >
> >
> > class TestWebResponseStream
> > {
> >   static void Main (string [] args)
> >   {
> >     HttpWebRequest myReq =
> > (HttpWebRequest)WebRequest.Create("http://www.go-mono.com");
> >     myReq.UserAgent="Mozilla/4.0 (compatible; monoWebResponseTest)";
> >     try
> >       {
> > 	HttpWebResponse myRes = (HttpWebResponse)myReq.GetResponse();
> > 	Stream respStream = myRes.GetResponseStream();
> > 	int respLength=(int)myRes.ContentLength;
> >
> > 	StreamReader reader =
> > 		     new StreamReader(respStream,
> > Encoding.ASCII,true,respLength);
> >
> > 	Console.WriteLine("Works to here");
> > 	Console.WriteLine(reader.ReadToEnd());
> > 	myRes.Close();
> >
> >       }
> >     finally { }
> >     }
> > }
> >
> > ===== Test End ======
> >
> > Peter Magnusson
> > mail:kmpm_se at msn.com
> >
> >
> >
> >
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list


_________________________________________________________________
Skaffa fler messengerkontakter - Vinn 10.000 i resecheckar! 
http://messenger.msn.se/promo




More information about the Mono-devel-list mailing list