public NmsSessionPool(NmsConnection connection, AcknowledgementMode acknowledgementMode, NmsConnectionPoolSettings settings) { this.connection = connection; this.AcknowledgementMode = acknowledgementMode; this.idleSessions = new Queue<NmsPooledSession>(); this.referencedSessions = new HashSet<NmsPooledSession>(); this.settings = settings; }
private void WireUpConnectionEvents(NmsConnection connection) { connection.ConnectionInterrupted += new EventHandler<NmsConnectionEventArgs>(connection_ConnectionInterrupted); connection.ConnectionResumed += new EventHandler<NmsConnectionEventArgs>(connection_ConnectionResumed); connection.ConnectionException += new EventHandler<NmsConnectionEventArgs>(connection_ConnectionException); }
public void ReturnConnection(NmsConnection connection) { this.AssertNotDisposed(); this.AssertIsStarted(); var pooledConnection = connection as NmsPooledConnection; if (pooledConnection == null) throw new InvalidOperationException("Attempted to return a non-pooled connection to the connection pool."); }
public void Dispose() { lock (this) { this.InnerStop(); this.connection = null; this.settings = null; this.idleSessions = null; this.referencedSessions = null; this.IsDisposed = true; } }
public NmsSessionPool(NmsConnection connection, NmsConnectionPoolSettings settings) : this(connection, connection.acknowledgementMode, settings) { }