In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/bc3331071e1ccbdab715397718bb00282f5c5e88?hp=4efcdc0252c3ba1728081298180489b8772bc6d6>
- Log ----------------------------------------------------------------- commit bc3331071e1ccbdab715397718bb00282f5c5e88 Author: Zefram <[email protected]> Date: Sun Nov 12 04:16:13 2017 +0000 document IO::Select error detection ----------------------------------------------------------------------- Summary of changes: dist/IO/lib/IO/Select.pm | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/dist/IO/lib/IO/Select.pm b/dist/IO/lib/IO/Select.pm index 994f8966ab..4d966418f9 100644 --- a/dist/IO/lib/IO/Select.pm +++ b/dist/IO/lib/IO/Select.pm @@ -11,7 +11,7 @@ use warnings::register; use vars qw($VERSION @ISA); require Exporter; -$VERSION = "1.22"; +$VERSION = "1.23"; @ISA = qw(Exporter); # This is only so we can do version checking @@ -315,10 +315,13 @@ Return an array of all registered handles. =item can_read ( [ TIMEOUT ] ) -Return an array of handles that are ready for reading. C<TIMEOUT> is -the maximum amount of time to wait before returning an empty list, in -seconds, possibly fractional. If C<TIMEOUT> is not given and any -handles are registered then the call will block. +Return an array of handles that are ready for reading. C<TIMEOUT> is the +maximum amount of time to wait before returning an empty list (with C<$!> +unchanged), in seconds, possibly fractional. If C<TIMEOUT> is not given +and any handles are registered then the call will block indefinitely. +Upon error, an empty list is returned, with C<$!> set to indicate the +error. To distinguish between timeout and error, set C<$!> to zero +before calling this method, and check it after an empty list is returned. =item can_write ( [ TIMEOUT ] ) @@ -346,9 +349,14 @@ like C<new>. C<READ>, C<WRITE> and C<EXCEPTION> are either C<undef> or C<IO::Select> objects. C<TIMEOUT> is optional and has the same effect as for the core select call. -The result will be an array of 3 elements, each a reference to an array -which will hold the handles that are ready for reading, writing and have -exceptions respectively. Upon error an empty list is returned. +If at least one handle is ready for the specified kind of operation, +the result will be an array of 3 elements, each a reference to an array +which will hold the handles that are ready for reading, writing and +have exceptions respectively. Upon timeout, an empty list is returned, +with C<$!> unchanged. Upon error, an empty list is returned, with C<$!> +set to indicate the error. To distinguish between timeout and error, +set C<$!> to zero before calling this method, and check it after an +empty list is returned. =back -- Perl5 Master Repository
