[Mono-devel-list] HttpWebRequest problem
Namit Dhameja
ndhameja at panaceasoftware.com
Wed Feb 18 12:36:45 EST 2004
Hi Gonzalo,
I am porting the code from Windows (MS .NET) to Linux (Mono). And I did
not have the same experience with "HttpWebRequest". That is, I did not have
to close the connection on MS .NET, "Flush()" seemed to do the trick.
Actually closing the connection seems an acceptable workaround. I just
wanted to bring to your notice that there is a difference in behaviour.
-Best Regards,
Namit.
----- Original Message -----
From: "Gonzalo Paniagua Javier" <gonzalo at ximian.com>
To: "Mono Development" <mono-devel-list at lists.ximian.com>
Sent: Wednesday, February 18, 2004 3:53 AM
Subject: Re: [Mono-devel-list] HttpWebRequest problem
> El mié, 18-02-2004 a las 04:24, Namit Dhameja escribió:
> > Hi all,
> > I am having a problem while sending out "HttpWebRequest". The
> > problem is unless you close the output stream the message is not
> > getting sent, so the response stream basically times out. Flushing the
> > stream also does not send the message. Sample code
> >
> > /// <summary>
> > /// Serialize SOAP data.
> > /// Set the content length of the string being posted.
> > /// </summary>
> > protected Stream stmRequest;
> > public void sendHttpData()
> > {
> > stmRequest = req.GetRequestStream();
> > byte[] b = ASCIIEncoding.Default.GetBytes(messageToSend);
> > stmRequest.Write(b,0,b.Length);
> > stmRequest.Flush();
> > stmRequest.Close (); // -------------Had to be added <WORKAROUND>
> > }
> >
> > Could someone suggest me any other way, is this a well know problem?.
>
> That's not a bug. It's a feature. MS .NET behaves that way.
>
> -Gonzalo
>
>
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
More information about the Mono-devel-list
mailing list