Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 May 1995 18:13:47 +0200 (MET DST)
From:      Christoph Kukulies <kuku@gilberto.physik.rwth-aachen.de>
To:        sven@stack.urc.tue.nl (Sven Berkvens)
Cc:        freebsd-hackers@freefall.cdrom.com (user alias)
Subject:   Re: accept(2) and listen(2)
Message-ID:  <199505231613.SAA16355@gilberto.physik.rwth-aachen.de>
In-Reply-To: <199505231351.PAA27529@zen.stack.urc.tue.nl> from "Sven Berkvens" at May 23, 95 03:51:25 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505231613.SAA16355>