2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>IO::Poll - Object interface to system poll call
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> IO::Poll - Object interface to system poll call
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#synopsis">SYNOPSIS
</a></li>
24 <li><a href=
"#description">DESCRIPTION
</a></li>
25 <li><a href=
"#methods">METHODS
</a></li>
26 <li><a href=
"#see_also">SEE ALSO
</a></li>
27 <li><a href=
"#author">AUTHOR
</a></li>
28 <li><a href=
"#copyright">COPYRIGHT
</a></li>
35 <h1><a name=
"name">NAME
</a></h1>
36 <p>IO::Poll - Object interface to system poll call
</p>
40 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
42 use IO::Poll qw(POLLRDNORM POLLWRNORM POLLIN POLLHUP);
</pre>
44 $poll = new IO::Poll;
</pre>
46 $poll-
>mask($input_handle =
> POLLIN);
47 $poll-
>mask($output_handle =
> POLLOUT);
</pre>
49 $poll-
>poll($timeout);
</pre>
51 $ev = $poll-
>events($input);
</pre>
55 <h1><a name=
"description">DESCRIPTION
</a></h1>
56 <p><code>IO::Poll
</code> is a simple interface to the system level poll routine.
</p>
60 <h1><a name=
"methods">METHODS
</a></h1>
62 <dt><strong><a name=
"item_mask">mask ( IO [, EVENT_MASK ] )
</a></strong>
65 <p>If EVENT_MASK is given, then, if EVENT_MASK is non-zero, IO is added to the
66 list of file descriptors and the next call to poll will check for
67 any event specified in EVENT_MASK. If EVENT_MASK is zero then IO will be
68 removed from the list of file descriptors.
</p>
71 <p>If EVENT_MASK is not given then the return value will be the current
72 event mask value for IO.
</p>
75 <dt><strong><a name=
"item_poll">poll ( [ TIMEOUT ] )
</a></strong>
78 <p>Call the system level poll routine. If TIMEOUT is not specified then the
79 call will block. Returns the number of handles which had events
80 happen, or -
1 on error.
</p>
83 <dt><strong><a name=
"item_events">events ( IO )
</a></strong>
86 <p>Returns the event mask which represents the events that happened on IO
87 during the last call to
<a href=
"#item_poll"><code>poll
</code></a>.
</p>
90 <dt><strong><a name=
"item_remove">remove ( IO )
</a></strong>
93 <p>Remove IO from the list of file descriptors for the next poll.
</p>
96 <dt><strong><a name=
"item_handles">handles( [ EVENT_MASK ] )
</a></strong>
99 <p>Returns a list of handles. If EVENT_MASK is not given then a list of all
100 handles known will be returned. If EVENT_MASK is given then a list
101 of handles will be returned which had one of the events specified by
102 EVENT_MASK happen during the last call ti
<a href=
"#item_poll"><code>poll
</code></a></p>
109 <h1><a name=
"see_also">SEE ALSO
</a></h1>
110 <p><a href=
"#item_poll">poll(
2)
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/IO/Handle.html">the IO::Handle manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/IO/Select.html">the IO::Select manpage
</a></p>
114 <h1><a name=
"author">AUTHOR
</a></h1>
115 <p>Graham Barr. Currently maintained by the Perl Porters. Please report all
116 bugs to
<<a href=
"mailto:perl5-porters@perl.org">perl5-porters@perl.org
</a>>.
</p>
120 <h1><a name=
"copyright">COPYRIGHT
</a></h1>
121 <p>Copyright (c)
1997-
8 Graham Barr
<<a href=
"mailto:gbarr@pobox.com">gbarr@pobox.com
</a>>. All rights reserved.
122 This program is free software; you can redistribute it and/or
123 modify it under the same terms as Perl itself.
</p>
124 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
125 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
126 <big><strong><span class=
"block"> IO::Poll - Object interface to system poll call
</span></strong></big>