Example #1
0
        /// <summary>
        /// Terminates all pending operations with the exception passed.
        /// </summary>
        /// <param name="e">The termination exception.</param>
        protected override void TerminatePendingOperations(Exception e)
        {
            using (TimedLock.Lock(this))
            {
                if (waitQueue != null)
                {
                    while (waitQueue.Count > 0)
                    {
                        waitQueue.Dequeue().Notify();
                    }
                }

                if (receiveQueue != null)
                {
                    while (receiveQueue.Count > 0)
                    {
                        receiveQueue.Dequeue().Notify();
                    }
                }

                if (session != null)
                {
                    session.Close();
                }
            }
        }
Example #2
0
        //---------------------------------------------------------------------
        // CommunicationObject implementation

        /// <summary>
        /// Closes the channel.
        /// </summary>
        /// <param name="timeout">The timeout <see cref="TimeSpan" />.</param>
        /// <remarks>
        /// The base class implementation does nothing.
        /// </remarks>
        protected override void OnClose(TimeSpan timeout)
        {
            session.Close();
        }