Apache.NMS.ActiveMQ.Connection.RemoveSession C# (CSharp) Method

RemoveSession() private method

private RemoveSession ( Session session ) : void
session Session
return void
        internal void RemoveSession(Session session)
        {
            if(!this.closing.Value)
            {
                sessions.Remove(session);
            }
        }

Usage Example

Example #1
0
        public void Close()
        {
            lock (this)
            {
                if (this.closed)
                {
                    return;
                }

                try
                {
                    StopAsyncDelivery();
                    Connection.RemoveSession(this);
                    foreach (MessageConsumer consumer in GetConsumers())
                    {
                        consumer.Close();
                    }
                    consumers.Clear();

                    foreach (MessageProducer producer in GetProducers())
                    {
                        producer.Close();
                    }
                    producers.Clear();
                }
                catch (Exception ex)
                {
                    Tracer.ErrorFormat("Error during session close: {0}", ex);
                }

                this.connection = null;
                this.closed     = true;
            }
        }
All Usage Examples Of Apache.NMS.ActiveMQ.Connection::RemoveSession