private static void StartServers() { deviceServer = new ProcessingServer(); deviceServer.Login(); deviceServer.Start(); dataServer = new LocalStorageServer(); dataServer.Start(); }
protected override void OnStart(string[] args) { var serviceStatus = new ServiceStatus(); serviceStatus.dwCurrentState = ServiceState.SERVICE_START_PENDING; serviceStatus.dwWaitHint = 10000; SetServiceStatus(this.ServiceHandle, ref serviceStatus); if (server != null) { server.Start(); } if (dataServer != null) { dataServer.Start(); } // Update the service state to Running. serviceStatus.dwCurrentState = ServiceState.SERVICE_RUNNING; SetServiceStatus(this.ServiceHandle, ref serviceStatus); }