Esempio n. 1
0
def main(ip, port=8000, uid=0, frontends=[('localhost', 8002), ('localhost', 8003)]):
    hosts = [(ip, port)] + frontends
    server = AsyncXMLRPCServer(uid, DatabaseRPCHandler, hosts)
    server.register_introspection_functions()
    server.register_instance(DBServerFunctions(server))
#    t = threading.Timer(10, server.check_time_server)
#    t.daemon = True
#    t.start()
    server.serve_forever()
Esempio n. 2
0
def main(ip, port=8002, uid=1, cache_pull_mode=False, db=('localhost', 8000), other_host=('localhost', 8003)):
    log_file = open("log_server.txt", "w+", 5)
    hosts = [('localhost', 8000), ('localhost', 8002), ('localhost', 8003)]
    server = AsyncXMLRPCServer(uid, ObelixRPCHandler, hosts)
    server.register_introspection_functions()
    server.register_instance(ObelixServerFunctions(log_file, cache_pull_mode, server, hosts[0]))
#    t = Timer(10, server.check_time_server)
#    t.daemon = True
#    t.start()
    server.serve_forever()