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

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

I know... That's the NORMAL way of doing things. But I want TWO
processes that accept(2) on the same socket at the same time...
Is that possible, and if so, what happens when a connection comes in?
ie. who gets the connection?

> 
> > 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?
> 

Sven Berkvens (sven@stack.urc.tue.nl)



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