[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Mario Garcia

8/2/2003 2:38:00 PM

There seems to be a 64 element limit on any socket list
passed as a argument to the select method. Is there any
way to change that limit?


1 Answer

Jonny Yu

8/3/2003 6:14:00 AM

0

Dear Mario,
I 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;
}

any comments are welcome.

regards,

Jonny Yu

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

"Mario Garcia" <mariog@acm.org> ????
news:002301c35903$9ae79cb0$a101280a@phx.gbl...
> There seems to be a 64 element limit on any socket list
> passed as a argument to the select method. Is there any
> way to change that limit?
>
>