Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id g2TJhsf23216 for netdev-outgoing; Fri, 29 Mar 2002 11:43:54 -0800 Received: from web13007.mail.yahoo.com (web13007.mail.yahoo.com [216.136.174.17]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id g2TJhkq23212 for ; Fri, 29 Mar 2002 11:43:46 -0800 Message-ID: <20020329194608.32090.qmail@web13007.mail.yahoo.com> Received: from [65.209.235.11] by web13007.mail.yahoo.com via HTTP; Fri, 29 Mar 2002 11:46:08 PST Date: Fri, 29 Mar 2002 11:46:08 -0800 (PST) From: Yan-Fa Li Subject: Re: Opening more than 65000 sockets To: Sridhar Samudrala , Ben Greear Cc: Yan-Fa Li , netdev@oss.sgi.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-netdev@oss.sgi.com Precedence: bulk Content-Length: 4653 Lines: 141 Thanks for the tip. I tried it out and it doesn't appear to work. It actually fails with a different return code EINVAL (22). Which isn't even a listed return code on the connect() man page :( Anybody else got any more ideas I can try ? Here's what I used: k=tcp and on=1 setsockopt(*opensock,k->p_proto,SO_REUSEADDR,&on,sizeof(on)); Is this the wrong syntax ? Anyway what I really want seems to be SO_REUSEPORT, and looking at the source code I see this in /usr/src/linux/include/asm/socket.h: #define SO_BSDCOMPAT 14 /* To add :#define SO_REUSEPORT 15 */ #define SO_PASSCRED 16 I guess we don't support this feature by design :( Any clues on if the support is in the kernel but not turned on ? Or is this something for 2.5 only ? Thanks Yan p.s. this is 2.4.19-pre3aa2 with /dev/epoll-31 patches. --- Sridhar Samudrala wrote: > On Fri, 29 Mar 2002, Ben Greear wrote: > > > > > > > Yan-Fa Li wrote: > > > > > It fails in the connect() call. I get EAGAIN messages. > > > They are TCP socekts. I have my file-max at 1 Million > > > files, and ulimit the same. > > > > > >>Port space is unique for a protocol (i.e.: TCP or UDP) > > >>across a host, independent of interfaces. > > >> > > > > > > That really looks like a bug or mis-feature to me. Why > > would we want this limitation? What would be the problems > > with fixing it to be per-local-interface? > > you can use the socket option SO_REUSEADDR to bind the same port to > multiple sockets, as long as each bind specifies a different localFrom owner-netdev@oss.sgi.com Fri Mar 29 12:49:39 2002 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id g2TJhsf23216 for netdev-outgoing; Fri, 29 Mar 2002 11:43:54 -0800 Received: from web13007.mail.yahoo.com (web13007.mail.yahoo.com [216.136.174.17]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id g2TJhkq23212 for ; Fri, 29 Mar 2002 11:43:46 -0800 Message-ID: <20020329194608.32090.qmail@web13007.mail.yahoo.com> Received: from [65.209.235.11] by web13007.mail.yahoo.com via HTTP; Fri, 29 Mar 2002 11:46:08 PST Date: Fri, 29 Mar 2002 11:46:08 -0800 (PST) From: Yan-Fa Li Subject: Re: Opening more than 65000 sockets To: Sridhar Samudrala , Ben Greear Cc: Yan-Fa Li , netdev@oss.sgi.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-netdev@oss.sgi.com Precedence: bulk Thanks for the tip. I tried it out and it doesn't appear to work. It actually fails with a different return code EINVAL (22). Which isn't even a listed return code on the connect() man page :( Anybody else got any more ideas I can try ? Here's what I used: k=tcp and on=1 setsockopt(*opensock,k->p_proto,SO_REUSEADDR,&on,sizeof(on)); Is this the wrong syntax ? Anyway what I really want seems to be SO_REUSEPORT, and looking at the source code I see this in /usr/src/linux/include/asm/socket.h: #define SO_BSDCOMPAT 14 /* To add :#define SO_REUSEPORT 15 */ #define SO_PASSCRED 16 I guess we don't support this feature by design :( Any clues on if the support is in the kernel but not turned on ? Or is this something for 2.5 only ? Thanks Yan p.s. this is 2.4.19-pre3aa2 with /dev/epoll-31 patches. --- Sridhar Samudrala wrote: > On Fri, 29 Mar 2002, Ben Greear wrote: > > > > > > > Yan-Fa Li wrote: > > > > > It fails in the connect() call. I get EAGAIN messages. > > > They are TCP socekts. I have my file-max at 1 Million > > > files, and ulimit the same. > > > > > >>Port space is unique for a protocol (i.e.: TCP or UDP) > > >>across a host, independent of interfaces. > > >> > > > > > > That really looks like a bug or mis-feature to me. Why > > would we want this limitation? What would be the problems > > with fixing it to be per-local-interface? > > you can use the socket option SO_REUSEADDR to bind the same port to > multiple sockets, as long as each bind specifies a different local IP > address. > In this way the port space becomes unique for each local ip address. > > Thanks > Sridhar > __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/