home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!unido!inasys!behe
- From: behe@inasys.UUCP (Bernd Hentig)
- Newsgroups: comp.unix.questions
- Subject: named pipe writer's end problem
- Message-ID: <2293@inasys.UUCP>
- Date: 28 Jul 92 08:09:54 GMT
- Distribution: comp
- Organization: inasys GmbH, Bonn, Germany
- Lines: 37
-
- Systems: ISC 3.x
- Compiler: gcc2.2.2
- Hello,
- I've got two processes S (server) and C (client).
- Process S creates a named pipe P and opens it in mode RD_ONLY.
-
- Process C opens the pipe P in mode WR_ONLY after process S
- is blocking on the open.
- Now C sends 10 messages to S via my own protocol layer,
- using select() and read() to get the message and write() to
- send the message.
-
- Then S (the reader) closes it's end of the pipe and C goes into
- a blocking select() call with the pipe descriptor set in the
- exceptional descriptor set.
-
- Question: If C does never write to this pipe again, how does it
- get notified of the closed pipe ???
- I do not get a SIGPIPE signal or an exceptional event as I expected
- and I do not want to use an additional server pipe that closes on read.
-
- If C closes the pipe before S, everything is o.k., the read gets
- 0 (EOF) as expected after the select() marked the pipe for reading.
-
- Is there anything I am not aware of (fnctl flags, ioctl, etc.) ?
- Can I use the select() call to wait on the write pipe when it's still
- open and then fails if it gets closed ?
- I didn't find any clues in Stevens Network Programming except using
- bidirectional pipes (spipe()) which are not what I want because
- they are much slower than real pipes (spipes are using streams, which
- are really painful for fast communications).
-
- Thanx for any suggestions (will post a summary, so you don't need to
- crowd comp.unix.questions ... what a horror ...)
- Bernd
-
-
-