I’m implementing some networking code using the selector pattern in C# / .NET 3.5. However, I was surprised to find that the Select method takes nongeneric IList‘s rather than IList<Socket>‘s. It says clearly in the help documentation though that a list of sockets is expected here and nothing else.
Does anyone know why this is the case?
From the docs:
That would have been a pretty interesting signature in .NET 1.0…
The signature can’t be changed without breaking existing callers. They could have added an overload, but I’m not sure it would have helped very much – if you’d tried to use the “new” overload with the wrong argument types (e.g.
List<string>instead ofList<Socket>) it would just have bound to the old overload.