private static void stop_services() { if (_core == null) return; var defaultHosting = _defaultHosting; var defaultProxy = _defaultProxy; var core = _core; _defaultHosting = null; _defaultProxy = null; _core = null; try { if (defaultHosting != null) defaultHosting.Close(); if (defaultProxy != null) defaultProxy.Close(); Helpers.TryCatch(_log, () => core.Stop(), ex => Helpers.ThrowNew<VcallException>(ex, _log, "Failed to stop default Vcall endpoint services")); } catch (Exception ex) { _log.Error(ex.GetDetailedMessage()); } _log.Info("Vcall services are stopped"); }
private static void start_services(VcallConfiguration vconfig) { if (_core != null) return; var core = Helpers.TryCatch(_log, () => VcallSubsystem.New(vconfig), ex => Helpers.ThrowNew<VcallException>(ex, _log, "Failed to create Vcall subsystem")); Helpers.TryCatch(_log, () => core.Start(), ex => Helpers.ThrowNew<VcallException>(ex, _log, "Failed to start Vcall subsystem")); _core = core; _defaultHosting = null; _defaultProxy = null; _log.Info("Vcall services are started"); }