[I assume this should go to the list]
On 12/27/05, alok <alokdube@xxxxxxxxxx> wrote:
[me:]
>> If the writing process is busy, and does not call select at
>> the right moment, it can miss the time when the pipe is closed.
> and what do you loose if this happens?
Maybe I wasn't clear enough. When Ethereal stops capturing, the named
pipe receiver is closed, and when it starts capturing again, the
receiver opens the pipe again.
If I loose this event, I don't know that I have to write the libpcap
header, and Ethereal will fail for that reason.
> Make it blocking?
They are blocking, but unless the fifo is full (I have not experienced
that yet), they return immediately.
> Write is a system call,
Write is a function first. I am not even sure that the function always
invokes the system call, if for example the write size is 0.
[...]
> I do not see how you can ever run into such a situation, the moment
> it sees a widowed pipe, you will get a signal.
If the pipe is closed while I am trying to write, yes. But it is
closed while I am not trying to write (because there is nothing to
write), then I get no signal. I was surprised by this myself, but it
is definitely what I observe.
Thomas