network programming and sockets constant description pollhup pollnval hang up invalid request if eventmask is omittedthe pollinpollpriand pollout events are checked unregister(fdremoves the file descriptor fd from the polling object raises keyerror if the file is not registered poll([timeout]polls for events on all the registered file descriptors timeout is an optional timeout specified in milliseconds returns list of tuples (fdevent)where fd is file descriptor and event is bitmask indicating events the fields of this bitmask correspond to the constants pollinpolloutand so on for exampleto check for the pollin eventsimply test the value using event pollin if an empty list is returnedit means timeout occurred and no events occurred advanced module features the select(and poll(functions are the most generally portable functions defined by this module on linux systemsthe select module also provides an interface to the edge and level trigger polling (epollinterface which can offer significantly better performance on bsd systemsaccess to kernel queue and event objects is provided these programming interfaces are described in the online documentation for select at advanced asynchronous / example the select module is sometimes used to implement servers based on tasklets or coroutines-- technique that can be used to provide concurrent execution without threads or processes the following advanced example illustrates this concept by implementing an / -based task scheduler for coroutines be forewarned--this is the most advanced example in the book and it will require some study for it to make sense you might also want to consult my pycon' tutorial " curious course on coroutines and concurrency(material import select import types import collections lib fl ff