Thanks guys, I too felt that the "easy" implementation felt a little inconsistent with the rest of the code, hence my reason for asking.

Regards,
Don


On 27/11/2011 15:50, exarkun@twistedmatrix.com wrote:
On 01:35 pm, itamar@itamarst.org wrote:
On 11/27/2011 06:58 AM, Don Schoeman wrote:
I've got a multiservice application running and I'm using the
MultiService class from twisted.application.service to do this. All my
existing services are setup as children of my multiservice instance.

In addition I'd like to run an XML/RPC server as as well. Is it ok if 
I
instantiate the XML/RPC listening server as per the examples?

r = MyXMLRPCServer()
reactor.listenTCP(7080, server.Site(r))

I've tried this and it does seem to peacefully co-exist alongside the
other services, but is this the correct way of implementing the 
XML/RPC
server on a multiservice application?
A more consistent way, though, would be to have a subclass of Service
hooked up to your multiservice. This service's startService method 
would
do the above, and stopService would do port.stopListening() on the port
returned from listenTCP.
eg

    from twisted.application.internet import TCPServer

    xmlrpcsvc = TCPServer(7080, server.Site(MyXMLRPCServer())
    xmlrpcsvc.setServiceParent(yourMultiService)

Jean-Paul

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python