/// <summary>
 /// This methods releases the resource by the instance.
 /// </summary>
 public void Dispose()
 {
     if (_topic != null)
     {
         _topic.Dispose();
     }
     if (_cache != null)
     {
         _cache.Dispose();
     }
 }
        /// <summary>
        /// This methods releases the resource by the instance.
        /// </summary>
        public void Dispose()
        {
            _isStarted = false;

            //Disposing the acquired resources.
            if (_topic != null)
            {
                _topic.Dispose();
            }
            if (_cache != null)
            {
                _cache.Dispose();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Disconnect and close all network resources without sending a disconnect event message.
        /// </summary>
        public static void Close()
        {
            //lock (allComChannels) {
            //	if (allComChannels != null) {
            //		foreach (ComChannel channel in allComChannels.Values) {
            //			Console.WriteLine(channel.channelID);
            //			channel._CloseInternal();
            //		}
            //		allComChannels = null;
            //	}
            //}

            if (connectionMessageProducer != null)
            {
                connectionMessageProducer.Close();
                connectionMessageProducer = null;
            }

            if (serverMessageConsumer != null)
            {
                serverMessageConsumer.Close();
                serverMessageConsumer = null;
            }

            if (localTempQueue != null)
            {
                localTempQueue.Dispose();
                localTempQueue = null;
            }

            if (connectionTopic != null)
            {
                connectionTopic.Dispose();
                connectionTopic = null;
            }

            if (mainSession != null)
            {
                mainSession.Close();
                mainSession = null;
            }

            if (connection != null)
            {
                connection.Close();
                connection = null;
            }
        }