예제 #1
0
        public void Test_That_Starved_SocketPool_Sends_StatusCode_SocketPoolTimeout()
        {
            try
            {
                s_cbClient = new CouchbaseClient("socket-timeout");

                List <Thread> workers = new List <Thread>();
                for (int i = 0; i < THREADS; i++)
                {
                    Thread t = new Thread(ThreadBody);
                    t.Priority = ThreadPriority.BelowNormal;
                    workers.Add(t);
                }
                foreach (Thread t in workers)
                {
                    t.Join();
                }
                Console.WriteLine();
                Console.WriteLine("done");
                Thread.Sleep(1000);
            }
            finally
            {
                s_cbClient.Dispose();
            }
        }
        public void Test_That_Starved_SocketPool_Sends_StatusCode_SocketPoolTimeout()
        {
            try
            {
                s_cbClient = new CouchbaseClient("socket-timeout");

                List<Thread> workers = new List<Thread>();
                for (int i = 0; i < THREADS; i++)
                {
                    Thread t = new Thread(ThreadBody);
                    t.Priority = ThreadPriority.BelowNormal;
                    workers.Add(t);
                }
                foreach (Thread t in workers)
                {
                    t.Join();
                }
                Console.WriteLine();
                Console.WriteLine("done");
                Thread.Sleep(1000);
            }
            finally
            {
                s_cbClient.Dispose();
            }
        }
 public void TearDown()
 {
     //clean up clients to avoid leakage
     if (_client != null)
     {
         _client.Dispose();
     }
 }
 public void Stop()
 {
     lock (syncObject)
     {
         clientInstance.Dispose();
         clientInstance = null;
     }
 }
예제 #5
0
 protected virtual void Dispose(bool disposing)
 {
     if (!this.disposed)
     {
         if (disposing)
         {
             client.Dispose();
         }
     }
     this.disposed = true;
 }
예제 #6
0
 /// <summary>
 /// Releases all resources associated with the client's connection to the Couchbase server.
 /// </summary>
 public void Dispose()
 {
     client.Dispose();
 }