[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


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):

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
  File "/usr/lib/python2.3/xmlrpclib.py", line 1070, in request
xmlrpclib.ProtocolError: <ProtocolError for localhost:7080/: -1 >

All suggestions / hints would be greatly appreciated.



Rasjid Wilcox
Melbourne, Australia (UTC +10 hrs)

More information about the Twisted-web mailing list