Module select
[hide private]
[frames] | no frames]

Module select

This module supports asynchronous I/O on multiple file descriptors.

*** IMPORTANT NOTICE *** On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors.

Classes [hide private]
error
Functions [hide private]
 
poll(...)
Returns a polling object, which supports registering and unregistering file descriptors, and then polling them for I/O events.
(rlist, wlist, xlist)
select(rlist, wlist, xlist, timeout=...)
Wait until one or more file descriptors are ready for some kind of I/O.
Variables [hide private]
  POLLERR = 8
  POLLHUP = 16
  POLLIN = 1
  POLLMSG = 1024
  POLLNVAL = 32
  POLLOUT = 4
  POLLPRI = 2
  POLLRDBAND = 128
  POLLRDNORM = 64
  POLLWRBAND = 512
  POLLWRNORM = 256
Function Details [hide private]

select(rlist, wlist, xlist, timeout=...)

 

Wait until one or more file descriptors are ready for some kind of I/O. The first three arguments are sequences of file descriptors to be waited for: rlist -- wait until ready for reading wlist -- wait until ready for writing xlist -- wait for an ``exceptional condition'' If only one kind of condition is required, pass [] for the other lists. A file descriptor is either a socket or file object, or a small integer gotten from a fileno() method call on one of those.

The optional 4th argument specifies a timeout in seconds; it may be a floating point number to specify fractions of seconds. If it is absent or None, the call will never time out.

The return value is a tuple of three lists corresponding to the first three arguments; each contains the subset of the corresponding file descriptors that are ready.

*** IMPORTANT NOTICE *** On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors.

Returns: (rlist, wlist, xlist)