1 import fcntl
2 import SocketServer
3 from SimpleXMLRPCServer import (SimpleXMLRPCDispatcher,
4 SimpleXMLRPCRequestHandler)
5 from DocXMLRPCServer import (XMLRPCDocGenerator,
6 DocXMLRPCRequestHandler)
7
10 """Threaded XML-RPC server.
11
12 Threaded XML-RPC server that allows functions and a single instance
13 to be installed to handle requests. The default implementation
14 attempts to dispatch XML-RPC calls to the functions or instance
15 installed in the server. Override the _dispatch method inherited
16 from SimpleXMLRPCDispatcher to change this behavior.
17 """
18
19 allow_reuse_address = True
20
21 - def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
22 logRequests=True, allow_none=False, encoding=None):
23 self.logRequests = logRequests
24
25 print "Initing ThreadedTCPServer"
26 SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
27 SocketServer.ThreadingTCPServer.__init__(self, addr, requestHandler)
28
29
30
31
32 if fcntl is not None and hasattr(fcntl, 'FD_CLOEXEC'):
33 flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD)
34 flags |= fcntl.FD_CLOEXEC
35 fcntl.fcntl(self.fileno(), fcntl.F_SETFD, flags)
36
39 """XML-RPC and HTML documentation server.
40
41 Adds the ability to serve server documentation to the capabilities
42 of SimpleXMLRPCServer.
43 """
44
45 - def __init__(self, addr, requestHandler=DocXMLRPCRequestHandler,
46 logRequests=1):
49