private void _updateCommunicationChannel(object sender, ElapsedEventArgs e) { try { if (_lastServiceStatus == ServiceStatus.Functional) { ServiceCommunicationChannel.ActionRequest(new ActionModel { ClientId = ClientId, Type = ActionType.UpdateChannel, ExecuteImmediately = true }); } else { Register(); } } catch (EndpointNotFoundException) { IsRegistered = false; _lastServiceStatus = ServiceStatus.Faulted; } finally { _updateCommunicationChannelTimer.Start(); } }
public void Unregister() { try { ServiceCommunicationChannel.ActionRequest(new ActionModel { ClientId = ClientId, Type = ActionType.UnregisterClient, ExecuteImmediately = true }); IsRegistered = false; } catch (EndpointNotFoundException) { IsRegistered = false; } }