Exemplo n.º 1
0
        public void Stop()
        {
            #region Logging
            MethodBase method = MethodBase.GetCurrentMethod();
            MethodName = method.Name;
            #endregion

            WebApiLogger?.Verbose(ClassName, MethodName, "Start");
            WebApiLogger?.Information(ClassName, MethodName, "Stopping Service");
            if (server != null)
            {
                Task.Run(() => server.Stop());
            }

            server = null;
            _webapp?.Dispose();
            WebApiLogger?.Verbose(ClassName, MethodName, "End");
        }
Exemplo n.º 2
0
        public void Start()
        {
            #region Logging
            MethodBase method = MethodBase.GetCurrentMethod();
            MethodName = method.Name;
            #endregion

            WebApiLogger?.Verbose(ClassName, MethodName, "Start");
            WebApiLogger?.Information(ClassName, MethodName, "Starting Service");
            WebApiLogger?.Information(ClassName, MethodName, "Loading configuration");
            var serverChannelLog = LoggingFactory.CreateLogger(configurations.LogPath, "server-channel.log", configurations.LogLevel);
            if (true)
            {
                WebApiLogger?.Information(ClassName, MethodName, "Instantiating TCP Server Channel");
                server = new EnhancedGateway(serverChannelLog);
                Task.Run(() => server.Start());
                //WebApiLogger?.Information(ClassName, MethodName, "Starting Job Scheduler");
                //Task.Run(() => TaskManager.StartJobScheduler());
            }

            //Task.Run(() => TaskManager.StartJobScheduler());
            _webapp = WebApp.Start <Startup>(configurations.Url);
            WebApiLogger?.Verbose(ClassName, MethodName, "End");
        }