예제 #1
0
    def __init__(self):
        try:
            managedInfo = init(transports.transports.keys())
        except EnvException:
            log.warn("Server managed-proxy protocol failed.")
            return

        log.debug("pyptlib gave us the following data:\n'%s'",
                  pprint.pformat(managedInfo))

        for transport, transport_bindaddr in managedInfo['transports'].items():
            ok, addrport = self.launchServer(transport, transport_bindaddr,
                                             managedInfo)
            if ok:
                log.debug("Successfully launched '%s' at '%s'" %
                          (transport, str(addrport)))
                reportSuccess(transport, addrport, None)
            else:
                log.info("Failed to launch '%s' at '%s'" %
                         (transport, str(addrport)))
                reportFailure(transport, 'Failed to launch')

        reportEnd()

        log.info("Starting up the event loop.")
        reactor.run()
예제 #2
0
    def __init__(self):
        try:
            managedInfo = init(transports.transports.keys())
        except EnvException:
            log.warn("Server managed-proxy protocol failed.")
            return

        log.debug("pyptlib gave us the following data:\n'%s'", pprint.pformat(managedInfo))

        for transport, transport_bindaddr in managedInfo['transports'].items():
            ok, addrport = self.launchServer(transport, transport_bindaddr, managedInfo)
            if ok:
                log.debug("Successfully launched '%s' at '%s'" % (transport, str(addrport)))
                reportSuccess(transport, addrport, None)
            else:
                log.info("Failed to launch '%s' at '%s'" % (transport, str(addrport)))
                reportFailure(transport, 'Failed to launch')

        reportEnd()

        log.info("Starting up the event loop.")
        reactor.run()
예제 #3
0
            if managed_info['ext_orport']:
                addrport = launch_transport.launch_transport_listener(
                    transport, transport_bindaddr, 'ext_server',
                    managed_info['ext_orport'],
                    managed_info['auth_cookie_file'])
            else:
                addrport = launch_transport.launch_transport_listener(
                    transport, transport_bindaddr, 'server',
                    managed_info['orport'])
        except transports.TransportNotFound:
            log.warning("Could not find transport '%s'" % transport)
            reportFailure(transport, "Could not find transport.")
            continue
        except error.CannotListenError:
            log.warning("Could not set up listener for '%s'." % transport)
            reportFailure(transport, "Could not set up listener.")
            continue

        should_start_event_loop = True
        log.debug("Successfully launched '%s' at '%s'" %
                  (transport, log.safe_addr_str(str(addrport))))
        reportSuccess(transport, addrport, None)

    reportEnd()

    if should_start_event_loop:
        log.info("Starting up the event loop.")
        reactor.run()
    else:
        log.info("No transports launched. Nothing to do.")
예제 #4
0
                addrport = launch_transport.launch_transport_listener(transport,
                                                                      transport_bindaddr,
                                                                      'ext_server',
                                                                      managedInfo['ext_orport'],
                                                                      managedInfo['auth_cookie_file'])
            else:
                addrport = launch_transport.launch_transport_listener(transport,
                                                                      transport_bindaddr,
                                                                      'server',
                                                                      managedInfo['orport'])
        except transports.TransportNotFound:
            log.warning("Could not find transport '%s'" % transport)
            reportFailure(transport, "Could not find transport.")
            continue
        except error.CannotListenError:
            log.warning("Could not set up listener for '%s'." % transport)
            reportFailure(transport, "Could not set up listener.")
            continue

        should_start_event_loop = True
        log.debug("Successfully launched '%s' at '%s'" % (transport, log.safe_addr_str(str(addrport))))
        reportSuccess(transport, addrport, None)

    reportEnd()

    if should_start_event_loop:
        log.info("Starting up the event loop.")
        reactor.run()
    else:
        log.info("No transports launched. Nothing to do.")