Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!uw-beaver!fluke!ssc-vax!voodoo!jdt From: jdt@voodoo.UUCP (Jim Tomlinson) Newsgroups: comp.unix.questions Subject: Server/exec/fork questions Message-ID: <599@voodoo.UUCP> Date: 20 Oct 89 00:33:02 GMT Organization: Voodoo Graphics Project, Everett WA Lines: 22 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."