[Mono-list] Bug in StreamWriter ??? (Mono 1.2.5 on Windows XP) ??

Aurelio Costa arcosta at gmail.com
Thu Sep 6 14:08:40 EDT 2007


May be I'm wrong, but i think that the problem is not on StreamWriter
but on the connection using HTTPS, look for this kind of error on list
history and you will see similar stuff.

2007/9/6, Andrew Tierney <andrew at castlesoft.com.au>:
> Some more info..
>
> The same code for a HTTP (not HTTPS) works fine on Mono 1.2.5..
>
> Regards
> Andrew
>
>
> Andrew Tierney wrote:
> > Hi All,
> >
> > I just tested a little VOIP account checker I had running on .NET 2.0
> > and it appears to crash on Mono 1.2.5.
> >
> > The code snippet in question is as follows: (basically go to the login
> > page, post details then save cookies and reply...)
> >
> > ================================================================================
> >
> >             string VOIPPage =
> > "https://billing.sipme.com.au:8445/login.html";
> >             string VOIPPOST = "user=USERID&password=MYPASSWORD&x=27&y=12";
> >
> >             HttpWebRequest req =
> > (HttpWebRequest)WebRequest.Create(VOIPPage);
> >             req.Method = "POST";
> >             req.CookieContainer = new CookieContainer();
> >             req.ContentType = "application/x-www-form-urlencoded";
> >             req.ContentLength = VOIPPOST.Length;
> >             StreamWriter sw = new StreamWriter(req.GetRequestStream());
> >             sw.Write(VOIPPOST);
> >             sw.Close();   // <<<==== CRASHES HERE..on MONO ??????
> >
> >             HttpWebResponse postRes = (HttpWebResponse)req.GetResponse();
> >             StreamReader sr = new StreamReader(postRes.GetResponseStream());
> >             string reply = sr.ReadToEnd();
> >
> > ======================================================================
> >
> > The Error when I run this on MONO 1.2.5 is:
> >
> > Unhandled Exception: System.Net.WebException: Error writing request.
> >   at System.Net.WebConnectionStream.WriteRequest () [0x00000]
> >   at System.Net.WebConnectionStream.Close () [0x00000]
> >   at System.IO.StreamWriter.Dispose (Boolean disposing) [0x00000]
> >   at System.IO.StreamWriter.Close () [0x00000]
> >   at Voip.Program.Main (System.String[] args) [0x00000]
> >
> > It works fine on .NET 2.0 on Windows XP Sp2..
> >
> > Any ideas ??
> >
> > Regards
> > Andrew
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Mono-list maillist  -  Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> >
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>


-- 
Aurelio R. Costa
http://aureliocosta.blogspot.com/


More information about the Mono-list mailing list