Richard Jones wrote:
On Thu, 2008-11-06 at 13:37 -0500, Thomas Harning wrote:
On Nov 6, 2008, at 1:30 PM, Richard Jones wrote:

......
i see:
Read 5 bytes from 0:'12345' Read 0 bytes from 0:'' Read 0 bytes from
0:'' Read 0 bytes from 0:'' ...

And the callback keeps firing forever, even tho I'm not sending any more
data. I can't find anything in the docs about having to acknowledge
events or dismiss them once fired or anything - what am i missing?

The successful read of zero bytes indicates end-of-stream.

Ah, so the < redirection in the shell is sending eof.. If i use:

No, the EOF comes from the `echo` process closing the write end of the 
fifo/pipe that your shell opened for it.

The < redirection just causes your shell to pass in the read end of the fifo as the stdin fd (and in fact, the shell will block on opening the fifo, and only exec proc once echo opens the fifo for write).


tail -f fifo | ./prog

i'm able to write multiple times to the fifo, which does what i want as
tail -f doesnt pass on eof.. that's doing what i want now.

`tail -f` just does nanosleep+read, an alternative solution is to have prog re-open the fifo (using O_NONBLOCK) after getting EOF from read, this works properly on linux, at least.


thanks,
RJ

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to