From: rav on 21 May 2010 05:10 I had similar problem with SimpleXMLRPCServer Create the request handler class class ExtendedXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): # originally this one was slowing down my server A LOT due to DNS settings!!! def log_request(self, *args): pass and put it in your SimpleXMLRPCServer constructor (...) class MyServer(threading.Thread): def __init__(self, host, port): threading.Thread.__init__(self) self.server = SimpleXMLRPCServer((host, port), ExtendedXMLRPCRequestHandler) self.server.register_function(self.is_even, "is_even") self.server.register_function(self.stop, "stop_server") (...) I would also change all 'localhost' occurences in the code to ip '127.0.0.1'. Good luck! Rafal
From: Adam Tauno Williams on 21 May 2010 08:16 On Fri, 2010-05-21 at 02:10 -0700, rav wrote: > I had similar problem with SimpleXMLRPCServer > Create the request handler class > class ExtendedXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): > # originally this one was slowing down my server A LOT due to DNS > settings!!! > def log_request(self, *args): > pass > and put it in your SimpleXMLRPCServer constructor > (...) > class MyServer(threading.Thread): > def __init__(self, host, port): > threading.Thread.__init__(self) > self.server = SimpleXMLRPCServer((host, port), > ExtendedXMLRPCRequestHandler) > self.server.register_function(self.is_even, "is_even") > self.server.register_function(self.stop, "stop_server") > (...) > I would also change all 'localhost' occurences in the code to ip > '127.0.0.1'. Or the better solution is to fix your resolver. -- Adam Tauno Williams <awilliam(a)whitemice.org> LPIC-1, Novell CLA <http://www.whitemiceconsulting.com> OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba
First
|
Prev
|
Pages: 1 2 Prev: How to unescape a raw string? Next: Transferring an exception from one thread to an other. |