Beispiel #1
0
 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();
     }
 }
Beispiel #2
0
        public void Unregister()
        {
            try
            {
                ServiceCommunicationChannel.ActionRequest(new ActionModel
                {
                    ClientId = ClientId, Type = ActionType.UnregisterClient, ExecuteImmediately = true
                });

                IsRegistered = false;
            }
            catch (EndpointNotFoundException) { IsRegistered = false; }
        }