Package bitfling :: Module xmlrpcstuff :: Class Server
[hide private]
[frames] | no frames]

Class Server

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        Server
Known Subclasses:

Nested Classes [hide private]
  Message
A message between a connection thread and the server object, or vice versa
  ConnectionThread
Instance Methods [hide private]
 
__init__(self, host, port, servercert, connectionthreadcount=5, timecheck=60, connectionidlebreak=240)
Creates the listening thread and infrastructure.
source code
 
shutdown(self)
Requests a shutdown of all threads
source code
 
run23(self) source code
 
run22(self) source code
 
run(self) source code
 
processmessage(self, msg) source code
 
OnLog(self, str)
Process a log message
source code
 
OnLogException(self, exc)
Process an exception message
source code
 
OnNewAccept(self, clientaddr)
Decide if we accept a new new connection
source code
 
OnNewUser(self, clientaddr, username, password)
Decide if a user is allowed to authenticate
source code
 
OnConnectionClose(self, clientaddr)
Called when a connection closes
source code
 
OnUserMessage(self, msg)
Called when a message arrives in the workqueue
source code
 
OnXmlRpcRequest(self, xmldata, username, clientaddr)
Called when an XML-RPC request arrives, but before the XML is parsed
source code
 
OnMethodDispatch(self, method, params, username, clientaddr)
Called once the XML-RPC request is parsed
source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, host, port, servercert, connectionthreadcount=5, timecheck=60, connectionidlebreak=240)
(Constructor)

source code 

Creates the listening thread and infrastructure. Don't forget to call start() if you want anything to be processed! You probably also want to call setDaemon(). Remember to load a certificate into the sslcontext.

Parameters:
  • connectionthreadcount - How many threads are being used. If new connections arrive while the existing threads are busy in connections, then they will be ignored
  • timecheck - How often shutdown requests are checked for in the main thread (only valid on Python 2.3+)
  • connectionidlebreak - If an SSH connection is idle for this amount of time then it is closed
Overrides: object.__init__

run(self)

source code 
Overrides: threading.Thread.run