[Twisted-web] Shutting down a xmlrpc server with an xmlrpc call

Rasjid Wilcox rasjidw at openminddev.net
Mon Jun 20 07:40:39 MDT 2005


Hi,

I am new to twisted-web, so my apologies if this is obvious.  I am happy to be 
pointed at the appropriate documentation.

I am writing an xmlrpc server, and would like to there to be an xmlrpc call to 
shutdown the server gracefully.

Ideally upon the call being made, it would return a 'success' response to the 
client, the reactor would stop taking any new requests, would finish any 
existing ones, and then exit cleanly.

What I currently have is -
    def xmlrpc_quit(self):
        reactor.stop()

but then the caller gets:

>>> import xmlrpclib
>>> s = xmlrpclib.Server('http://localhost:7080/')
>>> s.quit()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/xmlrpclib.py", line 1029, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.3/xmlrpclib.py", line 1316, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.3/xmlrpclib.py", line 1070, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for localhost:7080/: -1 >

All suggestions / hints would be greatly appreciated.

Cheers,

Rasjid.

-- 
Rasjid Wilcox
Melbourne, Australia (UTC +10 hrs)



More information about the Twisted-web mailing list