1N/A# Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved. 1N/A# This program is free software; you can redistribute it and/or 1N/A# modify it under the same terms as Perl itself. 1N/A# [0] maps fd's to requested masks 1N/A# [1] maps fd's to returned masks 1N/A# [2] maps fd's to handles 1N/A # We no longer have any handles for this FD 1N/A return values %{$
self->[
2]}
unless @_;
1N/AIO::Poll - Object interface to system poll call 1N/A use IO::Poll qw(POLLRDNORM POLLWRNORM POLLIN POLLHUP); 1N/A $poll = new IO::Poll; 1N/A $poll->mask($input_handle => POLLIN); 1N/A $poll->mask($output_handle => POLLOUT); 1N/A $poll->poll($timeout); 1N/A $ev = $poll->events($input); 1N/AC<IO::Poll> is a simple interface to the system level poll routine. 1N/A=item mask ( IO [, EVENT_MASK ] ) 1N/AIf EVENT_MASK is given, then, if EVENT_MASK is non-zero, IO is added to the 1N/Alist of file descriptors and the next call to poll will check for 1N/Aany event specified in EVENT_MASK. If EVENT_MASK is zero then IO will be 1N/Aremoved from the list of file descriptors. 1N/AIf EVENT_MASK is not given then the return value will be the current 1N/Aevent mask value for IO. 1N/A=item poll ( [ TIMEOUT ] ) 1N/ACall the system level poll routine. If TIMEOUT is not specified then the 1N/Acall will block. Returns the number of handles which had events 1N/Ahappen, or -1 on error. 1N/AReturns the event mask which represents the events that happend on IO 1N/Aduring the last call to C<poll>. 1N/ARemove IO from the list of file descriptors for the next poll. 1N/A=item handles( [ EVENT_MASK ] ) 1N/AReturns a list of handles. If EVENT_MASK is not given then a list of all 1N/Ahandles known will be returned. If EVENT_MASK is given then a list 1N/Aof handles will be returned which had one of the events specified by 1N/AEVENT_MASK happen during the last call ti C<poll> 1N/AL<poll(2)>, L<IO::Handle>, L<IO::Select> 1N/AGraham Barr. Currently maintained by the Perl Porters. Please report all 1N/Abugs to <perl5-porters@perl.org>. 1N/ACopyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved. 1N/AThis program is free software; you can redistribute it and/or 1N/Amodify it under the same terms as Perl itself.