[Mono-bugs] [Bug 32004][Wis] New - Problems with System.Net and threads
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
9 Oct 2002 15:22:45 -0000
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by tapia@eitig.com.
http://bugzilla.ximian.com/show_bug.cgi?id=32004
--- shadow/32004 Wed Oct 9 11:22:45 2002
+++ shadow/32004.tmp.9412 Wed Oct 9 11:22:45 2002
@@ -0,0 +1,45 @@
+Bug#: 32004
+Product: Mono/Class Libraries
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: tapia@eitig.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Problems with System.Net and threads
+
+* Description of Problem:
+
+In a multithread environment, I'm working with http connections. My code is
+something like this (it's a sample, it's not compilable):
+
+public void Method1 ()
+{
+ myThread = new Thread (new ThreadStart(Method2));
+}
+
+public void Method2 ()
+{
+HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+NetworkCredential giveCred = new NetworkCredential(user, passwd, host);
+CredentialCache putCache = new CredentialCache();
+putCache.Add(new Uri(url), "Basic", giveCred);
+request.Credentials = putCache;
+HttpWebResponse response = (HttpWebResponse)request.GetResponse();
+}
+
+When the execution arrives at the last line, the program hangs on.
+
+BUT, if I execute the same code without threads, it works perfectly.
+
+* Additional Information:
+
+Mono 0.16