IO::Poll (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
IO::Poll - Object interface to system poll callSYNOPSIS
use IO::Poll qw(POLLRDNORM POLLWRNORM POLLIN POLLHUP); $poll = IO::Poll->new(); $poll->mask($input_handle => POLLIN); $poll->mask($output_handle => POLLOUT); $poll->poll($timeout); $ev = $poll->events($input);
DESCRIPTION
"IO::Poll" is a simple interface to the system level poll routine.METHODS
- mask ( IO[,EVENT_MASK] )
-
If EVENT_MASKis given, then, ifEVENT_MASKis non-zero,IOis added to the list of file descriptors and the next call to poll will check for any event specified inEVENT_MASK.IfEVENT_MASKis zero thenIOwill be removed from the list of file descriptors.
If
EVENT_MASKis not given then the return value will be the current event mask value forIO. - poll ( [ TIMEOUT] )
-
Call the system level poll routine. If TIMEOUTis not specified then the call will block. Returns the number of handles which had events happen, or -1 on error.
- events ( IO)
-
Returns the event mask which represents the events that happened on IOduring the last call to "poll".
- remove ( IO)
-
Remove IOfrom the list of file descriptors for the next poll.
- handles( [ EVENT_MASK] )
-
Returns a list of handles. If EVENT_MASKis not given then a list of all handles known will be returned. IfEVENT_MASKis given then a list of handles will be returned which had one of the events specified byEVENT_MASKhappen during the last call ti "poll"