1IO::Poll(3pm)          Perl Programmers Reference Guide          IO::Poll(3pm)
2
3
4

NAME

6       IO::Poll - Object interface to system poll call
7

SYNOPSIS

9           use IO::Poll qw(POLLRDNORM POLLWRNORM POLLIN POLLHUP);
10
11           $poll = IO::Poll->new();
12
13           $poll->mask($input_handle => POLLIN);
14           $poll->mask($output_handle => POLLOUT);
15
16           $poll->poll($timeout);
17
18           $ev = $poll->events($input);
19

DESCRIPTION

21       "IO::Poll" is a simple interface to the system level poll routine.
22

METHODS

24       mask ( IO [, EVENT_MASK ] )
25           If EVENT_MASK is given, then, if EVENT_MASK is non-zero, IO is
26           added to the list of file descriptors and the next call to poll
27           will check for any event specified in EVENT_MASK. If EVENT_MASK is
28           zero then IO will be removed from the list of file descriptors.
29
30           If EVENT_MASK is not given then the return value will be the
31           current event mask value for IO.
32
33       poll ( [ TIMEOUT ] )
34           Call the system level poll routine. If TIMEOUT is not specified
35           then the call will block. Returns the number of handles which had
36           events happen, or -1 on error.
37
38       events ( IO )
39           Returns the event mask which represents the events that happened on
40           IO during the last call to "poll".
41
42       remove ( IO )
43           Remove IO from the list of file descriptors for the next poll.
44
45       handles( [ EVENT_MASK ] )
46           Returns a list of handles. If EVENT_MASK is not given then a list
47           of all handles known will be returned. If EVENT_MASK is given then
48           a list of handles will be returned which had one of the events
49           specified by EVENT_MASK happen during the last call ti "poll"
50

SEE ALSO

52       poll(2), IO::Handle, IO::Select
53

AUTHOR

55       Graham Barr. Currently maintained by the Perl Porters.  Please report
56       all bugs to <perlbug@perl.org>.
57
59       Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights
60       reserved.  This program is free software; you can redistribute it
61       and/or modify it under the same terms as Perl itself.
62
63
64
65perl v5.34.1                      2022-03-15                     IO::Poll(3pm)
Impressum