示例#1
0
 def __init__(self, args):
     self.__running = False
     self.__args = args
     print 'service created'
     self.__menu = InterfaceFactory.menu(False, self.__args)
     print 'services started: %s:%s' % (Config.get_server()['address'], Config.get_server()['web_port'])
     signal.signal(signal.SIGINT, self.quit)
示例#2
0
 def __init__(self):
     Thread.__init__(self)
     self.daemon = True
     self.__running = False
     self.__port = Config.get_server()['socket_update_port']
     self.__server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.__server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.__name = 'Update Server'
示例#3
0
 def __init__(self):
     Thread.__init__(self)
     self.daemon = True
     self.__running = False
     self.__master = SqlMaster()
     self.__port = Config.get_server().get('sql_port')
     self.__server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.__server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.__name = 'Sql Server'
示例#4
0
 def __init__(self):
     _server = Config.get_server()
     self.__congress = [
         Threaded(ghost=Ghost.SERVER,
                  ip=_server['address'],
                  port=_server['ghost_port']),
         Threaded(ghost=Ghost.UPDATE, port=_server['ghost_update_port'])
     ]
     self.__name = 'Ghost Server'
示例#5
0
 def __init__(self):
     Thread.__init__(self)
     self.daemon = True
     self.__running = False
     self.__master = SqlMaster()
     self.__port = Config.get_server().get('sql_port')
     self.__server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.__server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.__name = 'Sql Server'
示例#6
0
 def __init__(self, url):
     """
     Server object is used to host the normal WebServer.  No parameters are needed.
     """
     Thread.__init__(self)
     self.daemon = True
     self.__url = url
     _server = Config.get_server()
     self.__server = WebServer((_server['address'], _server['web_port']), ClientHandler)
     self.__server.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     self.__server.allow_reuse_address = socket.SO_REUSEADDR
     cert = _server['cert']
     key = _server['key']
     if cert and key:
         self.__server.socket = ssl.wrap_socket(self.__server.socket, certfile=cert, keyfile=key, server_side=True)
     self.__name = 'Web Server'
示例#7
0
 def __init__(self, url):
     """
     Server object is used to host the normal WebServer.  No parameters are needed.
     """
     Thread.__init__(self)
     self.daemon = True
     self.__url = url
     _server = Config.get_server()
     self.__server = WebServer((_server['address'], _server['web_port']),
                               ClientHandler)
     self.__server.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,
                                     1)
     self.__server.allow_reuse_address = socket.SO_REUSEADDR
     cert = _server['cert']
     key = _server['key']
     if cert and key:
         self.__server.socket = ssl.wrap_socket(self.__server.socket,
                                                certfile=cert,
                                                keyfile=key,
                                                server_side=True)
     self.__name = 'Web Server'
示例#8
0
class StaticSqlAccess(type):
    PORT = Config.get_server().get('sql_port')

    @staticmethod
    def set_port(port):
        StaticSqlAccess.PORT = port
示例#9
0
 def __init__post(self):
     _server = Config.get_server()
     self.__url = 'https://' if Config.get('cert') and Config.get('key') else 'http://'
     self.__url += '%s:%s' % (_server['address'], _server['web_port'])
     self.__servers = InterfaceFactory.servers(self.__cli, self.__url)
     self.__sql = InterfaceFactory.sql(self.__cli)
示例#10
0
 def __init__(self):
     _server = Config.get_server()
     self.__congress = [Threaded(ghost=Ghost.SERVER, ip=_server['address'], port=_server['ghost_port']),
                        Threaded(ghost=Ghost.UPDATE, port=_server['ghost_update_port'])]
     self.__name = 'Ghost Server'