poll.register() method in Python

The poll.register() method registers I/O event types to poll for on a file descriptor. The event types are POLLIN, POLLPRI, POLLOUT, POLLERR, POLLHUP, POLLRDHUP and POLLNVAL

Poll Updated 18 Oct 2018 1 min read

Method Name

poll.register

Method Signature

poll.register(fileDescriptor[, eventmask])

Method Overview

This method is invoked on a poll instance which is obtained through the select.poll() method. When called it registers a file descriptor for a set of I/O events. After registration poll.poll(timeout) method can be invoked to check for I/O events within the specific duration.

Event TypeDescription
POLLINData available for read
POLLPRIPriority data is ready for read
POLLOUTData can be written
POLLERRError Condition
POLLHUPHang-up by the writing end. EOF will be detected only after consuming all the data that has been written already.
POLLRDHUPA state in which the receiving-side of a TCP connection waits for data without knowing the connection has been closed by the peer. That is, the existence of an half-open connection.
POLLNVALDescriptor not open