private RemoveSession ( |
||
session | ||
Результат | void |
internal void RemoveSession(Session session)
{
if(!this.closing.Value)
{
sessions.Remove(session);
}
}
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; } }