Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
From: Chris Faylor <cgf@cygnus.com>
Date: Mon, 6 Dec 1999 18:07:43 -0500
To: Ross Smith <ross.s@ihug.co.nz>
Cc: cygwin@sourceware.cygnus.com
Subject: Re: More than 64 sockets ?
Message-ID: <19991206180743.A10476@cygnus.com>
Reply-To: cygwin@sourceware.cygnus.com
Mail-Followup-To: Ross Smith <ross.s@ihug.co.nz>,
	cygwin@sourceware.cygnus.com
References: <Pine.LNX.4.10.9912052255370.691-100000@bono.reversers.net> <199912061554.JAA15146@hp2.xraylith.wisc.edu> <19991206161728.C2223@cygnus.com> <19991206164843.B9747@cygnus.com> <384C3898.43BD108@ihug.co.nz>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0i
In-Reply-To: <384C3898.43BD108@ihug.co.nz>; from ross.s@ihug.co.nz on Tue, Dec 07, 1999 at 11:28:40AM +1300

On Tue, Dec 07, 1999 at 11:28:40AM +1300, Ross Smith wrote:
>Chris Faylor wrote:
>> 
>> On Mon, Dec 06, 1999 at 04:17:28PM -0500, Chris Faylor wrote:
>> >On Mon, Dec 06, 1999 at 09:54:39AM -0600, Mumit Khan wrote:
>> >>stefan <stefan@linux.f1.fhtw-berlin.de> writes:
>> >>> Hello,
>> >>>
>> >>> we were porting a server software to Win9x/NT and had to notice that you
>> >>> cannot accept() more than 64 sockets. Why is this ? Can anyone help us ?
>> >>
>> >>The underlying OS API, WaitForMultipleObjects, has a limit of 64 handles
>> >>it can wait on, and that's probably the reason. There are tricks to get
>> >>around it, but it requires creating multiple threads. Not pretty.
>> >
>> >This isn't a problem with cygwin.  Cygwin uses the Winsock select() for
>> >sockets.  There probably is a limit there but it's not 64.
>> 
>> Just to clarify:  The "This" above refers to the WaitForMultipleObjects
>> limit of 64 handles.  This particular hard limit probably does not affect
>> cygwin.
>> 
>> There is a hard-coded limit in winsock.h which is probably what is coming
>> to play here.
>
>This section from the Winsock Programming FAQ may be relevant:

This may be marginally relevant, but we're talking about Cygwin here.
Until a month or so ago, setting FD_SETSIZE to something else would have
been guaranteed to fail.  In recent snapshots it should work.

cgf

>> 3.17 - Can I change FD_SETSIZE to make select() wait on more than 64
>> sockets?
>>
>> You can, but in practice it may not work. Several common Winsock
>> stacks and Layered Service Providers limit themselves internally to
>> the default value of FD_SETSIZE, 64. However, you can write a test
>> program to try this on the systems you plan on supporting, to see if
>> they are not limited. Also, you can always send each group of 64
>> sockets to a different thread, so that several calls to select() can
>> occur simultaneously.
>
>(http://www.cyberport.com/~tangent/programming/winsock/)

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

