in reply to Re^6: How to make sysread timeout
in thread How to make sysread timeout

Again, if a (blocking) socket has received some data before the timeout, but not enough to satisfy the number specified on the sysread, can_read() will have returned true, but will sysread block or not?
I'd have thought that it's obvious that sysread blocks if there's no data, but otherwise returns the number of bytes actually read.

Those Win32 issues sound nasty. I have three questions:

-David

Replies are listed 'Best First'.
Re^8: How to make sysread timeout
by BrowserUk (Patriarch) on Nov 02, 2007 at 16:57 UTC
    I'd have thought that it's obvious that sysread blocks if there's no data, but otherwise returns the number of bytes actually read.

    Why is that obvious? It isn't mentioned under sysread, or select or in thePOD of IO::Select.

    Are all those problems documented somewhere?

    Depends what you call 'documented'?

    Not that I'm aware of in the Perl documentation beyond perhaps some oblique comments regarding 'legacy' or 'dosish' systems.

    The first discussion here at PM that I am aware of, and the basis of whatever I have discovered is Non blocking socket open. For a more complete list of the posts that mention the problems you could try google

    Are there any modules which mitigate that situation?

    None that I am aware of.

    If so, is there any reason why IO::Select, IO::Handle, etc can't be told to use them?

    See (tye)Re: Non blocking socket open


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.