Socket questions.

James Brister brister at td2cad.intel.com
Mon Oct 9 06:58:01 AEST 1989


Hi,
	I have a couple of questions regarding sockets on Ultrix 3.x.

1) I have a process that listens to a socket, when a connection request comes
in the process forks and the child takes care of the connection while the
parent goes back to listening for more connections. I've seen code do this
under the INET address family, but not under AF_UNIX and I was wondering... I
haven't seen this stated in the doc set, but is it guaranteed that if two child
process from the same parent are handling two connections at the same time that
the connections are really seperate (i.e. reads/writes to one won't get crossed
with the other). I'm about 95% certain this is safe (isn't this what lpd
does?), but the overloading of the (socket) filename bothers me.  Does this
also work with AF_UNIX (guaranteed?).  I've run some test cases and it looks
good, but I don't want to use something that may someday blow up in my face.

2) Is there some way for a process to wait for connections on more than one
socket and then handle the first one that comes through? (something along the
lines of select) Or am I stuck using multiple processes? 

Thanks.

James
--
James Brister                                          brister at td2cad.intel.com
Intel Corp.                                      {decwrl,oliveb}!td2cad!brister



More information about the Comp.unix.questions mailing list