December 2000
Intermediate to advanced
784 pages
20h 54m
English
IO::Poll is a little like IO::Select turned inside out. With the IO::Select API, you create multiple IO::Select sets—typically one each for reading and writing—and monitor them with a call to IO::Select->select(). With IO::Poll, you create a single IO::Poll object and add filehandles to it one at a time, each with a mask that indicates the conditions you are interested in monitoring. You then call the IO::Poll object's poll() method, which blocks until one or more of the conditions is met. After poll() returns, you interrogate the object to learn which handles were affected.
A typical program begins like this:
use IO::Poll qw(POLLIN POLLOUT POLLHUP);
This loads the IO::Poll module and brings in the three constants POLLIN,
Read now
Unlock full access