Server/exec/fork questions

Jim Tomlinson jdt at voodoo.UUCP
Fri Oct 20 10:33:02 AEST 1989


I'm writing a TCP-based server which will accept connections, and then
fork off a process to receive data on that connection while the server
goes back to listening for more connections.  I _could_ put the code for
the process that receives data right in the server; that's the way the
server algorithm in the _4.2BSD_Interprocess_Communication_Primer_ seems
to propose doing it.  On the other hand, Rochkind (in _Advanced_UNIX_
Programming_) states that 'without exec, fork is of no practical use at
all' (seems a bit strong).  The folks I work with feel that exec'ing the
'receive data' part of the process is the best solution, as each process
(listen and receive) contains only the code essential to doing it's job.
I'll buy that, but how do I pass that established socket connection to
the exec'ed process?  Does a socket, like an open file descriptor, remain
open in the exec'ed process?  Is Rochkind full of hoohah when it comes to
exec (are you there, Marc)?  Do I ask too many questions? 

Thanx in advance.


Jim Tomlinson                                                   (206) 234-7741
Boeing Computer Services                      ....uw-beaver!ssc-vax!voodoo!jdt
Renton, WA                                "Better to burn out than fade away."



More information about the Comp.unix.questions mailing list