cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: approaching another release

From: Joe Halpin <j.p.h_at_comcast.net>
Date: Tue, 18 May 2004 13:15:43 -0500

Gisle Vanem wrote:
> "Joe Halpin" <j.p.h_at_comcast.net> said:
>
>>+ /* Make sure sockfd won't overflow the fd_set */
>>+ if(sockfd >= FD_SETSIZE)
>>+ return WAITCONN_SELECT_ERROR;
>>+
> Which assumes sockets are numbered 0 - (FD_SETSIZE-1).
> This is not the case on Windows at least, where sockets are
> typically > 1000, but FD_SETSIZE is 64. i.e. max 64 sockets
> per process.
>
> If libcurl should do anything about this, it should probably
> check that # of active sockets are < FD_SETSIZE.

Is there some #define or other constant that can be used to determine
where sockets start? If so we could add that to FD_SETSIZE.

I don't know how we could determine which descriptors are active and
which aren't except by cycling through all possible ones and calling
getpeername() or something on each one.

Joe
Received on 2004-05-18