SimpleXMLRPCServer

Rembrandt Q Einstein hercules.rockefeller at springfield.??.us
Tue Sep 28 13:48:40 CEST 2004


Jeremy Jones wrote:
> PhysicsGenius wrote:
> 
>> Jeremy Jones wrote:
>>
>>> Istvan Albert wrote:
>>>
>>>> Yannick Turgeon wrote:
>>>>
>>>>> "Simple". What are its limitations? 
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> No limitations whatsoever ...  it is "Simple" to use
>>>>
>>>> :-0
>>>>
>>>> Istvan.
>>>>
>>> Simple indeed.  I don't know for sure the reasons for naming it 
>>> "Simple".  But it may have to do with the fact that the 
>>> out-of-the-box SimpleXMLRPCServer will only handle one request at a 
>>> time: a request comes in, the server accepts that request, blocking 
>>> until the method call returns, and the response is sent back to the 
>>> client.  It does not spawn a thread per request.  It does not 
>>> "select" among multiple requests.  It will not create a thread pool 
>>> for you.  If you want that added functionality, you can write a 
>>> little custom code to get it to spawn a thread per request.  A little 
>>> more code to only spawn n number of threads.  A little more code 
>>> still to create a thread pool.  And if you want a server that 
>>> "select"s among multiple requests, I'm not 100% sure, but I bet 
>>> Twisted has one of those.
>>
>>
>>
>> I have a non-threaded, select()ing SimpleXML-RPC server.  I have 
>> stressed it yet, but I have verified that the concept works.
> 
> 
> Is this something that you wrote, or are you using Twisted?  If it's 
> something you wrote, I'd love to see the code for it.
> 
> Jeremy
> 

Maybe "server" is too grand a term.  This is running inside an actual 
server, but this is really just a snippet of code for doing select() on 
an XML-RPC server socket.

server = XMLRPCServer.XMLRPCServer((ipAddr, port), logRequests=False)
while(True):
     inputs, outputs, exceptions = 
select.select([server.fileno(),],[], 								[], 									 
configOptions['tick'])
     if inputs:
         server.handle_request()




More information about the Python-list mailing list