Пример #1
0
        public void Start(int port)
        {
            CancellationTokenSource ctsHttp = new CancellationTokenSource();
            IDbOperator             DbOp    = new LiteDbOperator(DB_PATH);//加载数据库

            taskManager = TaskManager.Create();
            HttpServerAPIs api = new HttpServerAPIs(taskManager, DbOp, LOG_PATH);

            HttpServer.HttpServer httpServer = new HttpServer.HttpServer(taskManager.logger, api);
            var _ = httpServer.StartHttpService(ctsHttp, port);
        }
Пример #2
0
        public void Start(int port)
        {
            CancellationTokenSource ctsHttp = new CancellationTokenSource();

            userDB                   = new LiteDbOperator(USER_DB_PATH);//加载数据库
            sysDB                    = new LiteDbOperator(SYS_DB_PATH);
            taskManager              = TaskManager.Create();
            taskManager.OnTaskError += TaskManager_OnTaskError;
            taskManager.OnTaskMail  += TaskManager_OnTaskMail;
            HttpServerAPIs api = new HttpServerAPIs(taskManager, userDB, sysDB, LOG_PATH);

            HttpServer.HttpServer httpServer = new HttpServer.HttpServer(taskManager.logger, api);
            var _ = httpServer.StartHttpService(ctsHttp, port);
        }