in reply to select($rin,undef,undef,undef) only blocking once
The select function makes use of the C select(2) system call.
As the docs for select(2) state, file descriptors "will be watched to see if characters become available for reading (more precisely, to see if a read will not block ... a file descriptor is also ready on end-of-file)"
Once you've read data from the pipe once, the file pointer will be pointing at EOF, and hence the select call will always return ready.
In a situation like this, I would consider using a blocking read over blocking on file readiness; alternatively, look into the use of seek or sysseek to try to clear the file's EOF condition (which may not be possible - I can't test it here).
Hope that helps.
-- Foxcub
#include www.liquidfusion.org.uk
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: select($rin,undef,undef,undef) only blocking once
by rabbit7 (Initiate) on Jul 26, 2005 at 11:30 UTC | |
by Tanalis (Curate) on Jul 26, 2005 at 12:09 UTC | |
by rabbit7 (Initiate) on Jul 26, 2005 at 13:43 UTC | |
by Tanalis (Curate) on Jul 26, 2005 at 13:49 UTC | |
by rabbit7 (Initiate) on Jul 27, 2005 at 11:13 UTC |
In Section
Seekers of Perl Wisdom