From owner-freebsd-hackers Tue May 23 09:03:22 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA06241 for hackers-outgoing; Tue, 23 May 1995 09:03:22 -0700 Received: from campino.informatik.rwth-aachen.de (campino.Informatik.RWTH-Aachen.DE [137.226.225.2]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id JAA06235 for ; Tue, 23 May 1995 09:03:19 -0700 Received: from gilberto.physik.rwth-aachen.de by campino.informatik.rwth-aachen.de (4.1/campino-7) id AA12873; Tue, 23 May 95 18:02:50 +0200 Received: (from kuku@localhost) by gilberto.physik.rwth-aachen.de (8.6.8/8.6.9) id SAA16355; Tue, 23 May 1995 18:13:47 +0200 Message-Id: <199505231613.SAA16355@gilberto.physik.rwth-aachen.de> Subject: Re: accept(2) and listen(2) To: sven@stack.urc.tue.nl (Sven Berkvens) Date: Tue, 23 May 1995 18:13:47 +0200 (MET DST) Cc: freebsd-hackers@freefall.cdrom.com (user alias) In-Reply-To: <199505231351.PAA27529@zen.stack.urc.tue.nl> from "Sven Berkvens" at May 23, 95 03:51:25 pm From: Christoph Kukulies Reply-To: Christoph Kukulies X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1131 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > Hi everyone! > > Just a small question about listen(2) and accept(2). > > Say I make a process A which creates a socket, binds it to a port, > and does a listen(2) on it. Then I fork the process, which creates Why that? You fork the process normally after accepting and close the socket for the parent. The child inherits the socket and works with it while the parent listens to new connections. > another process B. Now I make both A and B accept(2) on the socket. > What happens if a connection attempt is made? Does A or B get it, > or is this random? Or does only A get it? > > A little remark about listen(2). In the manpage it is stated that > listen(2) only supports a maximum of 5 pending connections in its > queue. Is this number hardcoded? If so, where can I change it :) ? > > Thanks for looking at this, > Sven Berkvens (sven@stack.urc.tue.nl) > --Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de FreeBSD blues.physik.rwth-aachen.de 2.0-BUILT-19950507 FreeBSD 2.0-BUILT-1995 0507 #0: Sun May 7 18:08:05 MET DST 1995 root@blues.physik.rwth-aachen.d e:/usr/src/sys/compile/BLUESGUS i386