in reply to Re^2: IO::Select and alarm()
in thread IO::Select and alarm()
There's a difference between can_read and select. can_read returns immediately when the object has no file handles, but I assumed it sleeps indefinitely like select in that situation.
That means there's a bug in my earlier version. The OP's code is equivalent to
use Errno qw( EINTR ); while ($select->count()) { my @ready = $select->can_read() or do { next if $! == EINTR; last; # Should be die("select: $!\n"); }; for my $fh (@ready) { ... } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: IO::Select and alarm()
by markseger (Beadle) on Nov 01, 2011 at 14:33 UTC | |
by ikegami (Patriarch) on Nov 01, 2011 at 19:56 UTC | |
by markseger (Beadle) on Nov 02, 2011 at 12:07 UTC | |
by ikegami (Patriarch) on Nov 02, 2011 at 19:34 UTC |