Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Timeouts: Any alternative to alarm in Win32?

by ikegami (Patriarch)
on Dec 04, 2008 at 12:27 UTC ( [id://727951]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Timeouts: Any alternative to alarm in Win32?
in thread Timeouts: Any alternative to alarm in Win32?

can_read() sometimes (often?) returns true when nothing is available.

Well that's problematic! I know it returns true when the handle has been closed. That's a good thing. sysread returns zero allowing you to handle disconnects. But I presume that's not what you mean.

I simply don't know if IO::Select suffers the same limitations as select, but I suspect that it probaly does.

IO::Select is just a thin wrapper for select that handles packing and unpacking the bit vectors for you. If it affects select, it affects IO::Select.

Mixing select with buffered IO seems to give unreliable results.

As documented. select translates into a system call and pays no attention to Perl's buffers.

I'm very shy of using select or IO::Select in conjuction with blocking IO (the diamond operator and friends).

As you should be. The diamond operator does buffered I/O which is incompatible with select.

when I get bitten a few times, I tend to get shy.

It wasn't a trick question. I have little real-world experience in the matter. Thanks for the info.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-24 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found