Path: utzoo!attcan!telly!lethe!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!gargoyle!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: Help: pipe accross two processes Message-ID: <1990Dec06.194310.16726@chinet.chi.il.us> Date: 6 Dec 90 19:43:10 GMT References: <1510@ulowell.ulowell.edu> <1990Dec5.225853.1370@gtisqr.uucp> Organization: Chinet - Public Access UNIX Lines: 29 In article <1990Dec5.225853.1370@gtisqr.uucp> roger@gtisqr.uucp (Roger Droz) writes: >The server can open(2) several named pipes with O_NDELAY set and start >polling. >You will need to come up with some mechanism of lock files to keep two >clients from opening the same pipe. On the contrary - the server can accept all input from a single pipe and not have to bother with O_NDELAY or polling. The constraint to this method is that a logical request from a client (i.e. the chunk of data that can't be interleaved with requests from other clients) must be less than PIPE_BUF (typically 5120) bytes and delivered in a single write(). Also, all writes() must use a pre-arranged fixed length, a length count as the first field, or a delimiter of some sort to allow the server to find the boundaries. A server running in this mode would generally open the FIFO for write access itself even though it will never write to it in order to make the reads block until a client completes a write(). >You will also need two pipes for each >client to accomplish two way communication, but I assume you already know >that. The client still needs one pipe of its own for communication in the other direction. Les Mikesell les@chinet.chi.il.us