Manage connections and tasks like a server.
Mostly just manages the tasks, any socket related duties are passed on
to the
|
|
__init__(self,
doneflag,
timeout_check_interval,
timeout,
ipv6_enable=True,
sockethandler=None,
excflag=Event())
Initialize the instance and start the socket handler. |
source code
|
|
threading.Event
|
|
|
|
_add_task(self,
func,
delay,
id=None)
Add the task to the sorted list of tasks to execute. |
source code
|
|
|
|
add_task(self,
func,
delay=0,
id=None)
Add the task to the list of tasks to schedule. |
source code
|
|
|
|
scan_for_timeouts(self)
Scan the open sockets for any timeouts. |
source code
|
|
|
|
bind(self,
port,
bind='',
reuse=True,
ipv6_socket_style=1)
Bind to listen on a single port. |
source code
|
|
int
|
find_and_bind(self,
minport,
maxport,
bind='',
reuse=True,
ipv6_socket_style=1,
randomizer=True)
Bind to listen on a single port within a range. |
source code
|
|
|
SocketHandler.SingleSocket
|
|
|
SocketHandler.SingleSocket
|
|
dictionary
|
|
|
|
pop_external(self)
Add the waiting externally added tasks to the list of tasks to
process. |
source code
|
|
|
|
|
boolean
|
|
boolean
|
|
|
|
wait_until_finished(self)
Wait until the server is done listeneing. |
source code
|
|
|
|
_kill_tasks(self)
Remove the pending list of tasks to remove from those tasks still
pending. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
shutdown(self)
Shutdown the socket handler. |
source code
|
|
list
|
dead_from_write
not used
|
threading.Event
|
doneflag
flag to indicate the program is to be shutdown
|
int
|
exccount
number of exceptions that have occurred
|
threading.Event
|
excflag
the flag to use to indicate an exception has occurred
|
list of (float, method,
unknown)
|
externally_added
externally queued tasks to add to funcs
|
threading.Event
|
finished
whether the server is done listening
|
list of (float, method,
unknown)
|
funcs
the list of future methods to invoke, the time to invoke at, the
method, and the ID to use to identify the method
|
dictionary
|
servers
not used
|
dictionary
|
single_sockets
not used
|
|
SocketHandler.SocketHandler
|
sockethandler
the handler to use to manage all open sockets
|
list
|
tasks_to_kill
the IDs of tasks to remove from funcs
|
float
|
timeout
seconds to wait between closing sockets on which nothing has been
received on
|
float
|
timeout_check_interval
seconds to wait between checking if any connections have timed
out
|