Package DebTorrent :: Module selectpoll :: Class poll
[hide private]
[frames] | no frames]

Class poll

source code

Polling object to poll open sockets for events.

Instance Methods [hide private]
 
__init__(self)
Initialize the instance.
source code
 
register(self, f, t)
Register a socket for polling.
source code
 
unregister(self, f)
Unregister a socket from being polled.
source code
list of (int, int)
poll(self, timeout=None)
Poll the registered sockets for events.
source code
Instance Variables [hide private]
list of int rlist
the socket file descriptors waiting for data
list of int wlist
the socket file descriptors waiting to send data
Method Details [hide private]

register(self, f, t)

source code 
Register a socket for polling.
Parameters:
  • f (int or socket.socket) - the file descriptor, or the socket to get the file descriptor from
  • t (int) - the events to poll for

unregister(self, f)

source code 
Unregister a socket from being polled.
Parameters:
  • f (int or socket.socket) - the file descriptor, or the socket to get the file descriptor from

poll(self, timeout=None)

source code 
Poll the registered sockets for events.
Parameters:
  • timeout (int) - number of seconds to wait before timing out and returning
Returns: list of (int, int)
the socket file descriptors and event types that have occurred on them