def _setupDistribServer(self, child):
    '\n        Set up a resource on a distrib site using L{ResourcePublisher}.\n\n        @param child: The resource to publish using distrib.\n\n        @return: A tuple consisting of the host and port on which to contact\n            the created site.\n        '
    distribRoot = resource.Resource()
    distribRoot.putChild(b'child', child)
    distribSite = server.Site(distribRoot)
    self.f1 = distribFactory = PBServerFactory(distrib.ResourcePublisher(distribSite))
    distribPort = reactor.listenTCP(0, distribFactory, interface='127.0.0.1')
    self.addCleanup(distribPort.stopListening)
    addr = distribPort.getHost()
    self.sub = mainRoot = distrib.ResourceSubscription(addr.host, addr.port)
    mainSite = server.Site(mainRoot)
    mainPort = reactor.listenTCP(0, mainSite, interface='127.0.0.1')
    self.addCleanup(mainPort.stopListening)
    mainAddr = mainPort.getHost()
    return (mainPort, mainAddr)
Set up a resource on a distrib site using L{ResourcePublisher}.

@param child: The resource to publish using distrib.

@return: A tuple consisting of the host and port on which to contact
    the created site.
def _setupDistribServer(self, child):
    '\n        Set up a resource on a distrib site using L{ResourcePublisher}.\n\n        @param child: The resource to publish using distrib.\n\n        @return: A tuple consisting of the host and port on which to contact\n            the created site.\n        '
    distribRoot = resource.Resource()
    distribRoot.putChild(b'child', child)
    distribSite = server.Site(distribRoot)
    self.f1 = distribFactory = PBServerFactory(distrib.ResourcePublisher(distribSite))
    distribPort = reactor.listenTCP(0, distribFactory, interface='127.0.0.1')
    self.addCleanup(distribPort.stopListening)
    addr = distribPort.getHost()
    self.sub = mainRoot = distrib.ResourceSubscription(addr.host, addr.port)
    mainSite = server.Site(mainRoot)
    mainPort = reactor.listenTCP(0, mainSite, interface='127.0.0.1')
    self.addCleanup(mainPort.stopListening)
    mainAddr = mainPort.getHost()
    return (mainPort, mainAddr)