public static void DisconnectIpc(bool unregister = true) { if (unregister && RemotingObject != null) { RemotingObject.UnregisterCallbackClient(); } if (unregister && PipeFactory != null) { PipeFactory.Close(); } RemotingObject = null; PipeFactory = null; }