public void Start() { var appDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Directory.SetCurrentDirectory(appDir); _configSection = (ServiceConfigurationSection)ConfigurationManager.GetSection("webSocketsHost"); _runtimeConfig = RuntimeServiceConfiguration.Load(_configSection.RuntimeConfigPath); LoadApplications(); var url = _configSection.ListenUrl; var sslCertificateSerialNumber = _configSection.CertificateSerialNumber; _server.Start(url, sslCertificateSerialNumber); _inactiveAppCheckTimer = new Timer(state => CheckInactiveApplications()); var applicationInactiveCheckInterval = _configSection.ApplicationInactiveCheckInterval * 60 * 1000; _inactiveAppCheckTimer.Change(applicationInactiveCheckInterval, applicationInactiveCheckInterval); _managerServiceHost.Open(); }
public Application(WebSocketServerBase server, ServiceConfigurationSection configuration, ApplicationConfiguration appConfig) { _log = LogManager.GetLogger(GetType()); _server = server; _hostPipeName = string.Format(configuration.HostPipeName, appConfig.Host); _appPipeName = string.Format(configuration.AppPipeName, appConfig.Host); _terminateTimeout = configuration.ApplicationTerminateTimeout; _host = appConfig.Host; _exePath = appConfig.ExePath; _commandLineArgs = appConfig.CommandLineArgs; _userName = appConfig.UserName; _userPassword = appConfig.UserPassword; _state = ApplicationState.Inactive; _inactiveStartTime = DateTime.MaxValue; }