Пример #1
0
        /// <summary>
        ///     Disconnect disconnects the Client from the Amqp Server.
        /// </summary>
        /// <param name="code">The status code of the disconnect.</param>
        /// <param name="text">The status text of the disconnect.</param>
        public void Disconnect(ushort code, string text)
        {
            lock (PublishChannel)
            {
                PublishChannel.Close(code, text);
            }

            foreach (var value in SubscribeChannels.Values)
            {
                value.Close();
            }
            WriteConnection.Close(code, text);
            ReadConnection.Close(code, text);
        }