[Mono-dev] Socket has a dynamic GetHashCode method
robertj at gmx.net
Mon Aug 13 18:16:44 EDT 2007
David Wolinsky wrote:
> Socket relies on the underlying operating system handle for its
> HashCode, this creates a problem if later after the underlying resource
> has been disposed but the Socket object is still in use....
> For example...
> Hashtable ht = new Hashtable();
> Socket s = new Socket(...);
> ht[s] = 5;
> Console.WriteLine(ht.Contains(s)); // true
> Console.WriteLine(ht.Contains(s)); // false
> Is this a bug or an expected result?
This is expected under .NET 1.1. Under .NET 2.0, MS has removed
the overloaded GetHashCode, like in the attached patch.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Mono-devel-list