xmlrpc / SimpleXMLRPCServer and multi-threading

M

Marco Aschwanden

I would like to develop a server based on python's xmlrpc. But I
realized that SimpleXMLRPCServer does not spawn a thread for each
request.

How could the SimpleXMLRPCServer be turned into a multi-threaded
Server?
Is there a reason why the SimpleXMLRPCServer is not multi-threaded?
Is there a plan to make it multi-threaded?

Thanks for any hints in advance,
Cheers,
Marco
 
V

vivek

I would like to develop a server based on python's xmlrpc. But I
realized that SimpleXMLRPCServer does not spawn a thread for each
request.

How could the SimpleXMLRPCServer be turned into a multi-threaded
Server?
Is there a reason why the SimpleXMLRPCServer is not multi-threaded?
Is there a plan to make it multi-threaded?

Thanks for any hints in advance,
Cheers,
Marco

I had also faced the same problem some time ago. To use the SimpleXMLRPCServer as a multithreaded server, I just changed the SocketServer.TCPServer to SocketServer.ThreadingTCPServer in the definition of the SimpleXMLRPCServer class and it worked fine for me. But it was on Python 2.2 and I haven't tried on later versions.

HTH,
Vivek Kumar
 
S

Shalabh Chaturvedi

Marco said:
How could the SimpleXMLRPCServer be turned into a multi-threaded
Server?

Look for ThreadingMixin in the SocketServer reference. You should be able to
create a new class derived from both SimpleXMLRPCServer and ThreadingMixIn
to achieve a thread-per-request server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top