Esempio n. 1
0
    def __init__(self, API, host="localhost", port=8000):
        threading.Thread.__init__(self)
        verbosity = False
        if (config.VERBOSE):
            verbosity = True

        self._Server = BetterXMLServer((host, port),
                                       logRequests=verbosity,
                                       allow_none=True)
        #self._Server = SimpleXMLRPCServer((host, port), requestHandler=XMLRPCHandler, logRequests=verbosity)
        self._Server.register_introspection_functions()
        self._Server.register_instance(API)
        self._Server.register_function(self.stop, "stop")
        self._Server.register_function(self.is_alive, "is_alive")
Esempio n. 2
0
    def __init__(self, API, host = "localhost", port = 50000):
        threading.Thread.__init__(self)
        verbosity = False
        if (config.VERBOSE):
            verbosity = True

        self._Server = BetterXMLServer ((host, port), logRequests = verbosity, allow_none = True)
        #self._Server = SimpleXMLRPCServer((host, port), requestHandler=XMLRPCHandler, logRequests=verbosity)
        self._Server.register_introspection_functions()
        self._Server.register_instance(API)
        self._Server.register_function(self.stop, "stop")
        self._Server.register_function(self.is_alive, "is_alive")
Esempio n. 3
0
class XMLRPC(threading.Thread):
    _Server = None

    def __init__(self, API, host = "localhost", port = 50000):
        threading.Thread.__init__(self)
        verbosity = False
        if (config.VERBOSE):
            verbosity = True

        self._Server = BetterXMLServer ((host, port), logRequests = verbosity, allow_none = True)
        #self._Server = SimpleXMLRPCServer((host, port), requestHandler=XMLRPCHandler, logRequests=verbosity)
        self._Server.register_introspection_functions()
        self._Server.register_instance(API)
        self._Server.register_function(self.stop, "stop")
        self._Server.register_function(self.is_alive, "is_alive")

    def run(self):
        log.write("Launching XML-RPC server [" + str(self._Server.server_address[0]) + ":" + str(self._Server.server_address[1]) + "]")
        self._Server.serve_forever()

    def stop(self):
        log.write("XML-RPC Server stopped")
        self._Server.shutdown()

    def is_alive(self):
        return True
Esempio n. 4
0
class XMLRPC(threading.Thread):
    _Server = None

    def __init__(self, API, host="localhost", port=8000):
        threading.Thread.__init__(self)
        verbosity = False
        if (config.VERBOSE):
            verbosity = True

        self._Server = BetterXMLServer((host, port),
                                       logRequests=verbosity,
                                       allow_none=True)
        #self._Server = SimpleXMLRPCServer((host, port), requestHandler=XMLRPCHandler, logRequests=verbosity)
        self._Server.register_introspection_functions()
        self._Server.register_instance(API)
        self._Server.register_function(self.stop, "stop")
        self._Server.register_function(self.is_alive, "is_alive")

    def run(self):
        log.write("Launching XML-RPC server [" +
                  str(self._Server.server_address[0]) + ":" +
                  str(self._Server.server_address[1]) + "]")
        self._Server.serve_forever()

    def stop(self):
        log.write("XML-RPC Server stopped")
        self._Server.shutdown()

    def is_alive(self):
        return True