There seems to be a 64 element limit on any socket list
passed as a argument to the select method.
Someone else in the forum traced the IL code, and found
some problems in the following code, I don't know if it is
a bug.
In this method , it first stored the count of the
socketlist we passed in with out any range check,
and then if the count isn't zero, the method will always
allocate a native int[64] array, which ofcourse doesn't
match with the value in FileDescriptorSet.Count, then the
IndexOutOfRangeException is thrown in the following codes.
maybe the conceptual code in c# like this:
FileDescriptorSet(Int32 count) {
Count = count;
if (!Count)
Array = new IntPtr(64);
else Array = null;
}
System.Net.Sockets.FileDescriptorSet
..method public hidebysig specialname rtspecialname
instance void .ctor(int32 count) cil managed
{
// Code size 27 (0x1b)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32
System.Net.Sockets.FileDescriptorSet::Count
IL_0007: ldarg.0
IL_0008: ldarg.1
IL_0009: brfalse.s IL_0014
IL_000b: ldc.i4.s 64
IL_000d: newarr [mscorlib]System.IntPtr
IL_0012: br.s IL_0015
IL_0014: ldnull
IL_0015: stfld native int[]
System.Net.Sockets.FileDescriptorSet::Array
IL_001a: ret
} // end of method FileDescriptorSet::.ctor
Any comments are welcome.