protected override void OnStop() { try { _logger.Info("Service is stopping"); LogEvent("Service is stopping"); _vpnConnection.Disconnect(); if (!_ipv6.Enabled) { _ipv6.Enable(); } foreach (var host in _hosts.ToList()) { _hosts.Remove(host); host.Dispose(); } } catch (Exception ex) { _logger.Error(ex); LogEvent($"OnStop: {ex}"); SentrySdk.WithScope(scope => { scope.Level = SentryLevel.Error; scope.SetTag("captured_in", "Service_OnStop"); SentrySdk.CaptureException(ex); }); } }
public void Disconnect(VpnError error) { _connectRequested = false; _disconnectedReceived = false; _origin.Disconnect(error); }
public Task Disconnect(SettingsContract settings, VpnErrorTypeContract vpnError) { _logger.Info("Disconnect requested"); _serviceSettings.Apply(settings); _vpnConnection.Disconnect(Map(vpnError)); return(Task.CompletedTask); }
public void Disconnect(VpnError error) { _origin.Disconnect(error); }
public void Disconnect(VpnError error = VpnError.None) { _origin.Disconnect(error); RestoreNetworkSettings(); }