Пример #1
0
        /// <summary>
        /// The dispose.
        /// </summary>
        /// <param name="disposing">
        /// The disposing.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (this.ipcChannel != null)
            {
                ((IChannel)this.ipcChannel).Abort();
                this.ipcChannel = null;
            }

            if (this.ipcChannelFactory != null)
            {
                this.ipcChannelFactory.Abort();
                this.ipcChannelFactory = null;
            }

            base.Dispose(disposing);
        }
Пример #2
0
        /// <summary>
        ///     The reset ipc channel.
        /// </summary>
        private void ResetIpcChannel()
        {
            lock (this.ipcChannelLock)
            {
                if (this.ParentProcess != null)
                {
                    if (this.ipcChannel != null)
                    {
                        ((IChannel)this.ipcChannel).Abort();
                        this.ipcChannel = null;
                    }

                    if (this.ipcChannelFactory != null)
                    {
                        this.ipcChannelFactory.Abort();
                        this.ipcChannelFactory = null;
                    }

                    this.ipcChannelFactory = this.CreateChannelFactory();
                    this.ipcChannel        = this.CreateChannel(this.ipcChannelFactory);
                }
            }
        }