Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: What makes IO::Select::can_read return?

by Joost (Canon)
on Feb 01, 2005 at 22:38 UTC ( [id://427083]=note: print w/replies, xml ) Need Help??


in reply to What makes IO::Select::can_read return?

If I read the docs:
can_read ( [ TIMEOUT ] ) Return an array of handles that are ready for reading. "TIM +EOUT" is the maximum amount of time to wait before returning an empt +y list, in seconds, possibly fractional. If "TIMEOUT" is not given and + any han- dles are registered then the call will block.

It never says it's always going to wait for the TIMEOUT, it just says it's not going to wait longer than the timeout.

AFAIK this might be a bug in perl, a bug in your OS, or it might be a completely reasonable effect of the way select() is implemented... According to my select(2) manpage (on Linux) errno should be set when select(2) returns -1. Try printing $! in your else routine.

Also note that you should not use buffered IO when using select (so use sysread() and syswrite() instead of read() if you don't already).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427083]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-20 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found