/// <summary> /// Ping method to verify an open and active service channel is currently established between /// the client and the service. /// /// Wraps CFXManagerClient:IsConnected() in the local exception handling framework /// </summary> /// <returns>true IFF the client is open and connected to the API service</returns> public bool ClientIsConnected() { lock (m_lock_object) { try { return(CFXManagerClient.IsConnected()); } catch (Exception ex) { OnClientError(new ClientErrorEventArgs(new ErrorRecord(ex, System.Reflection.MethodBase.GetCurrentMethod().Name))); } return(false); } }
/// <summary> ///Close the client. Must be called by the consumer application prior to exiting to ensure that the client ///unregisters from the service, and that all client related resources are freed. Failure to call this ///method will at the very least prevent any future client connections from being established with the API ///service during the current CFX Manager session. /// ///Wraps CFXManagerClient:CloseClient() in the local exception handling framework /// </summary> public void CloseClient() { lock (m_lock_object) { try { if (CFXManagerClient.IsConnected()) { Unregister(); } CFXManagerClient.AbortClient(); } catch (Exception ex) { OnClientError(new ClientErrorEventArgs(new ErrorRecord(ex, System.Reflection.MethodBase.GetCurrentMethod().Name))); } } }