Exemple #1
0
 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;
 }
Exemple #2
0
 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);
 }
Exemple #3
0
        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.");
        }
Exemple #4
0
        public void Dispose()
        {
            lock (this)
            {
                this.InnerStop();

                this.connection = null;
                this.settings = null;
                this.idleSessions = null;
                this.referencedSessions = null;

                this.IsDisposed = true;
            }
        }
Exemple #5
0
 public NmsSessionPool(NmsConnection connection, NmsConnectionPoolSettings settings)
     : this(connection, connection.acknowledgementMode, settings)
 {
 }