[PythonCE] very slow XMLRPCServer
David McNab
rebirth at orcon.net.nz
Sun May 17 22:43:46 CEST 2009
Hi,
I'm trying to run an XML-RPC server on my ipaq h4100, based on the
python 'SimpleXMLRPCServer', but it's ridiculously slow to process
requests.
Turnaround for even the simplest client requests is around 30-40
seconds.
Can anyone suggest a cause and maybe a remedy?
(source code to test program below)
Thanks if you can help
Cheers
David
-----------------------
from SimpleXMLRPCServer import SimpleXMLRPCServer
def add(x, y):
"""add(x, y): returns the result of adding x to y"""
return x + y
class MyXmlRpcServer(SimpleXMLRPCServer):
def __init__(self, *args, **kw):
SimpleXMLRPCServer.__init__(self, allow_none=1, *args, **kw)
self.running = 1
def serve_forever(self):
while self.running:
self.handle_request()
def stop(self):
"""stop(): stops the server"""
self.running = 0
server = MyXmlRpcServer(("", 8000))
server.register_function(add)
server.register_function(server.stop)
server.register_introspection_functions()
server.serve_forever()
More information about the PythonCE
mailing list