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 [EMAIL PROTECTED]

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

--- shadow/82449        2007-08-15 12:40:28.000000000 -0400
+++ shadow/82449.tmp.19032      2007-08-15 12:40:28.000000000 -0400
@@ -0,0 +1,73 @@
+Bug#: 82449
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 001 One hour
+Priority: Blocker
+Component: System
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Socket GetHashCode relies on the OS handle which once disposed is no 
longer valid
+
+Description of Problem:
+Socket GetHashCode relies on the OS handle which once disposed is no longer
+valid
+
+Hashtable ht = new Hashtable();
+Socket s = new Socket(...);
+ht[s] = 5;
+Console.WriteLine(ht.Contains(s)); // true
+s.Close();
+Console.WriteLine(ht.Contains(s)); // false
+
+Actual Results:
+
+
+Expected Results:
+The second Console.WriteLine should be true
+
+How often does this happen? 
+Every
+
+The patch below was provided by Robert Jordan
+
+Index: System.Net.Sockets/ChangeLog
+===================================================================
+--- System.Net.Sockets/ChangeLog       (revision 84012)
++++ System.Net.Sockets/ChangeLog       (working copy)
+@@ -1,3 +1,7 @@
++2007-08-13   Robert Jordan  <[EMAIL PROTECTED]>
++
++      * Socket.cs: Remove 2.0 GetHashCode overload.
++
+ 2007-08-02  Dick Porter  <[EMAIL PROTECTED]>
+ 
+       * Socket.cs: Patch from Brian Nickel ([EMAIL PROTECTED]) to
+Index: System.Net.Sockets/Socket.cs
+===================================================================
+--- System.Net.Sockets/Socket.cs       (revision 84012)
++++ System.Net.Sockets/Socket.cs       (working copy)
+@@ -3240,10 +3240,16 @@
+                               throw new SocketException (error);
+               }
+ 
++#if ONLY_1_1
+               public override int GetHashCode ()
+               {
++                      // LAMESPEC:
++                      // The socket is not suitable to serve as a hash code,
++                      // because it will change during its lifetime, but
++                      // this is how MS.NET 1.1 implemented this method.
+                       return (int) socket; 
+               }
++#endif
+ 
+               protected virtual void Dispose (bool explicitDisposing)
+               {
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to