From owner-freebsd-hackers Sun Jun 13 8:46:21 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id DE0FA14E07 for ; Sun, 13 Jun 1999 08:46:18 -0700 (PDT) (envelope-from des@flood.ping.uio.no) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.1) id RAA28184; Sun, 13 Jun 1999 17:46:15 +0200 (CEST) (envelope-from des) To: Brian Feldman Cc: Dag-Erling Smorgrav , hackers@FreeBSD.ORG Subject: Re: select(2) breakage References: From: Dag-Erling Smorgrav Date: 13 Jun 1999 17:46:13 +0200 In-Reply-To: Brian Feldman's message of "Sun, 13 Jun 1999 11:01:26 -0400 (EDT)" Message-ID: Lines: 33 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Brian Feldman writes: > On 13 Jun 1999, Dag-Erling Smorgrav wrote: > > connect() normally uses the 1024-5000 range. Try the following: > > > > # sysctl -w net.inet.ip.portrange.last=40000 > > > > and see if it solves the EAGAIN problem. > > Actually, this is the perfect explanation. I think that this should go in > the FAQ. Why in the world are we limiting the ports we can use other than > from 1-1023? I have no idea. The only use I've ever had for this is the predictability of FTP data port numbers, since ftpd will normally use the high range (49152-65535). Useful for designing firewalls, and if you don't like opening such a wide port range, you can whittle it down to a handful (say, one thousand) of ports with judicious use of sysctl. I couldn't find any reference to this in RFC 793, 1122, 1123, 1700 or 2577. Remind me to build a glimpse index of my RFC collection... This still doesn't explain select()'s failure to time out, although I should point out that you forgot to increase FD_SETSIZE before including , and I'm not sure your computation of highestsock is correct, since there's no guarantee that fdvec is sorted. I haven't tested your code though, I just looked over it quickly. BTW, you should check for errno == EINTR when select() returns -1. DES -- Dag-Erling Smorgrav - des@flood.ping.uio.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message