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

Module selectpoll

source code

Provides socket polling for operating systems that don't support it.

This class is similar to the select module in the standard library, and provides the needed functionality for operating systems that don't support it in the select module.

Classes [hide private]
  poll
Polling object to poll open sockets for events.
Functions [hide private]
 
remove(list, item)
Efficiently remove items from a sorted list.
source code
 
insert(list, item)
Efficiently insert items into a sorted list.
source code
 
test_remove()
Test the remove function.
source code
 
test_insert()
Test the insert function.
source code
Variables [hide private]
int POLLIN = 1
There is data to read
int POLLOUT = 2
Ready for output: writing will not block
int POLLERR = 8
Error condition of some sort
int POLLHUP = 16
Hung up

Imports: select.select, select.error, time.sleep, types.IntType, bisect.bisect


Function Details [hide private]

remove(list, item)

source code 

Efficiently remove items from a sorted list.

If the item is not in the liost, does nothing.
Parameters:
  • list (list of int) - the list
  • item (int) - the item to remove

insert(list, item)

source code 

Efficiently insert items into a sorted list.

If the item is already in the list, does nothing.
Parameters:
  • list (list of int) - the list
  • item (int) - the item to insert