Sol : MultiThreaded XMLRPCServer was (Re: How to get success/failure in case of thread)

vivek at cs.unipune.ernet.in vivek at cs.unipune.ernet.in
Thu Jul 31 12:26:01 CEST 2003


> vivek at cs.unipune.ernet.in wrote in message news:<mailman.1059552864.3047.python-list at python.org>...

> >   How can I use multiple threads in SimpleXMLRPCServer ???
> > 
> > TIA and Kind Regards
> > Vivek Kumar

OK, so I was looking in the wrong direction. But it is not entirely my fault.
There is no mention of ThreadingTCPServer in the Standard Python Documentation. 
There is only one line in documentation of SocketServer module like :

"The solution is to create a separate process or thread to handle each request;
the ForkingMixIn and ThreadingMixIn mix-in classes can be used to support 
asynchronous behaviour."

But still there was no mention that some TCP or UDP server are already
implemented there on these classes. Anyway, after reading the code in the 
SockerServer module and finding that there is already a ThreadingTCPServer 
available all other thing becomes very very easy. 

To implement the Threaded XMLRPCServer I just copied the code of 
SimpleXMLRPCServer into a new file and changed the SocketServer.TCPServer to
SocketServer.ThreadingTCPServer. That is all I have done and now it is a 
multithreaded XMLRPCServer :-).

But I think that the Python Documentation (Library reference) should contain
the documentation for all the modules provided with the standard Python 
distribution.

Again a BIG THX for all you people's support and help

Kind Regards
Vivek Kumar





More information about the Python-list mailing list