Ethereal-dev: [Ethereal-dev] Re: Named Pipe

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "John McDermott" <jjm@xxxxxxxxxx>
Date: Wed, 28 Dec 2005 11:29:33 -0700
On Tue, 27 Dec 2005 11:00:09 -0700, <ethereal-dev-request@xxxxxxxxxxxx> wrote:

Is there any way to determine (without side effects) that a pipe has
been closed? Writing to the pipe will give you EPIPE (and SIGPIPE) if
it is closed, but I cannot find a way to test this without writing
anything.

You will have to test it on multiple platforms, but I think poll() finds the event POLLERR when the pipe is open for writing, POLLHUP if it is open for reading.

--john


--
John McDermott, CCP
Writer, Educator, Consultant
jjm@xxxxxxxxxx        www.jkintl.com
V: +1 505/377-6293  F: +1 505/377-6313