コード例 #1
0
        protected override void OnClose()
        {
            active = false;

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

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

            if (messagePump != null && messagePump.IsAlive)
            {
                messagePump.Abort();
                messagePump.Join(5000);
            }

            messagePump   = null;
            loggingBuffer = null;

            base.OnClose();
        }
コード例 #2
0
        /// <summary>
        /// Sending the message via AMQP
        /// </summary>
        /// <param name="message">Message to be sent</param>
        private void SendAmqpMessage(string message)
        {
            if (amqpTransport == null)
            {
                amqpTransport = new AmqpTransport()
                {
                    IpAddress   = GetIpAddressFromHostName(),
                    Port        = AmqpServerPort,
                    VirtualHost = AmqpVirtualHost,
                    User        = AmqpUser,
                    Password    = AmqpPassword,
                    Queue       = AmqpQueue
                };
            }

            amqpTransport.Send(message);
        }
コード例 #3
0
        protected override void OnClose()
        {
            if (amqpTransport != null)
            {
                amqpTransport.Close();
                amqpTransport = null;
            }

            messagePump.Abort();
            messagePump.Join(5000);

            messagePump = null;

            base.OnClose();
        }
コード例 #4
0
        /// <summary>
        /// Sending the message via AMQP
        /// </summary>
        /// <param name="message">Message to be sent</param>
        private void SendAmqpMessage(string message)
        {
            if (amqpTransport == null)
            {
                amqpTransport = new AmqpTransport()
                {
                    IpAddress = GetIpAddressFromHostName(),
                    Port = AmqpServerPort,
                    VirtualHost = AmqpVirtualHost,
                    User = AmqpUser,
                    Password = AmqpPassword,
                    Queue = AmqpQueue
                };
            }

            amqpTransport.Send(message);
        }
コード例 #5
0
        protected override void OnClose()
        {
            active = false;

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

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

            if (messagePump != null && messagePump.IsAlive)
            {
                messagePump.Abort();
                messagePump.Join(5000);
            }

            messagePump = null;
            loggingBuffer = null;

            base.OnClose();
        }