in reply to Re^5: How to make sysread timeout
in thread How to make sysread timeout
Unfortunately, the tutorial is pretty much useless for a win32 user as
I've also wondered what happens (under *nix) if you call can_read() on a file handle connected to a file that is being written to by another process (as when tailing a file), if some new data has been written (and could therefore be read), but not enough has been written to satisfy the number of characters requested in the sysread?
Does sysread return immediately with just that number of characters as are available, or does it block indefinitely waiting until it can satisfy the full read request?
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?
It's also the case that using the blocking => 1 parameter to IO::Socket->new() also does not work under win32. Whilst it is possible to set Win32 sockets non-blocking, and the means is discussed here at PM, the details are somewhat shrouded in mystery and are not discussed or even mentioned in any of the Perl docs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: How to make sysread timeout
by erroneousBollock (Curate) on Nov 02, 2007 at 12:22 UTC | |
by BrowserUk (Patriarch) on Nov 02, 2007 at 16:57 UTC |