Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / August 2003

Tip: Looking for answers? Try searching our database.

Socket Select Limit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mario Garcia - 02 Aug 2003 15:37 GMT
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?
Jonny Yu - 03 Aug 2003 07:14 GMT
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

> 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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.