To make simpleXMLRPC support multi-thread

dieter dieter at handshake.de
Fri Aug 9 02:34:27 EDT 2013


Zhang JiaQiang <zhangjiaqiang at gmail.com> writes:

> I try to use simpleXMLRPC and support request multithreads ,used ThreadingMixIn.
>
> Why what I get from the console still blocking ?

I am not sure - but, you fail to call the inherited "__init__" method
in your deriving class. This might things mess up.

> ...
> class ListDirRPCServer(ThreadingMixIn, SimpleXMLRPCServer):
>     def __init__(self, ip, port):
>         self.server = SimpleXMLRPCServer((ip, port), logRequests=True)
>         self.server.register_function(list_contents)

Usually, in a derived class's "__init__" method, you should
call the inherited "__init__" method.




More information about the Python-list mailing list