Example #1
0
 public Connection(ConnectionManager connectionManager, WebSocket socket, int bufferSize)
 {
     _connectionManager = connectionManager;
     _socket            = socket;
     _bufferSize        = bufferSize;
     _inBuffer          = new byte[_bufferSize];
     _logger            = LoggingFactory.CreateLogger <Connection>();
 }
 public WebServer()
 {
     #region Logging
     MethodBase method = MethodBase.GetCurrentMethod();
     MethodName = method.Name;
     #endregion
     configurations = WebApiServerConfigurationManager.Instance.Configurations;
     WebApiLogger   = LoggingFactory.CreateLogger(configurations.LogPath, "web-api.log", configurations.LogLevel);
 }
Example #3
0
        public void Start()
        {
            string methodName = MethodBase.GetCurrentMethod().Name;

            try
            {
                log = LoggingFactory.CreateLogger(EmailManager.Instance.Configurations.LogPath,
                                                  "EmailSender", EmailManager.Instance.Configurations.LogLevel);

                timer          = new Timer();
                timer.Interval = EmailManager.Instance.Configurations.FolderMonitoringIntervalInSeconds * 1000;
                timer.Elapsed += Timer_Elapsed;

                timer.Start();
            }
            catch (Exception ex)
            {
                log?.Error(className, methodName, ex.ToString());
            }
        }
        public void Start()
        {
            string methodName = MethodBase.GetCurrentMethod().Name;

            try
            {
                log = LoggingFactory.CreateLogger(ServiceMonitorConfigurationManager.Instance.Configurations.LogPath,
                                                  "ServiceMonitor", ServiceMonitorConfigurationManager.Instance.Configurations.LogLevel);

                var list = GetServiceInfo();

                serviceManager = new WindowsServiceInfoManager(log, list);
                timer          = new Timer();
                timer.Interval = ServiceMonitorConfigurationManager.Instance.Configurations.IntervalInSeconds * 1000;
                timer.Elapsed += Timer_Elapsed;

                timer.Start();
            }
            catch (Exception ex)
            {
                log?.Error(className, methodName, ex.ToString());
            }
        }
        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");
        }