<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <font face="Arial">Thanks guys, I too felt that the "easy"
      implementation felt a little inconsistent with the rest of the
      code, hence my reason for asking.<br>
      <br>
      Regards,<br>
      Don<br>
      <br>
    </font><br>
    On 27/11/2011 15:50, <a class="moz-txt-link-abbreviated" href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a> wrote:
    <blockquote
cite="mid:20111127135022.2308.1092065824.divmod.xquotient.323@localhost.localdomain"
      type="cite">
      <pre wrap="">On 01:35 pm, <a class="moz-txt-link-abbreviated" href="mailto:itamar@itamarst.org">itamar@itamarst.org</a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">On 11/27/2011 06:58 AM, Don Schoeman wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">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?
</pre>
        </blockquote>
        <pre wrap="">
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.
</pre>
      </blockquote>
      <pre wrap="">
eg

    from twisted.application.internet import TCPServer

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

Jean-Paul

_______________________________________________
Twisted-Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a>
<a class="moz-txt-link-freetext" href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>

</pre>
    </blockquote>
  </body>
</html>