[Mono-bugs] [Bug 81105][Wis] Changed - TCPClient.Connected returning NullReference after closing TCPClient

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Mar 10 16:00:35 EST 2007


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 marco.gario at email.it.

http://bugzilla.ximian.com/show_bug.cgi?id=81105

--- shadow/81105	2007-03-10 15:57:57.000000000 -0500
+++ shadow/81105.tmp.28212	2007-03-10 16:00:35.000000000 -0500
@@ -2,13 +2,13 @@
 Product: Mono: Class Libraries
 Version: 1.0
 OS: All
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Wishlist
 Component: System
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: marco.gario at email.it               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -39,6 +39,39 @@
 
 
 ------- Additional Comments From marco.gario at email.it  2007-03-10 15:57 -------
 Created an attachment (id=18877)
 Test file
 
+
+------- Additional Comments From marco.gario at email.it  2007-03-10 16:00 -------
+while coding the test, I think I found the problem:
+
+protected virtual void Dispose (bool disposing)
+		{
+			if (disposed)
+				return;
+			disposed = true;
+
+			if (disposing){
+				// release managed resources
+				NetworkStream s = stream;
+				stream = null;
+				if (s != null) {
+					// This closes the socket as well, as 
+the NetworkStream
+					// owns the socket.
+					s.Close();
+					active = false;
+					s = null;
+				} else if (client != null){
+					client.Close ();
+				}
+				client = null;
+			}
+		}
+
+Dispose is really closing the socket, and setting to null. Probably 
+this is not done on MS framework. 
+I think mono way is the right, so I strongly suggest to correct the 
+problem with the patch I sent (well, its not really a patch...)
+


More information about the mono-bugs mailing list