TestAmqpBroker.TestAmqpBroker.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
        public void Start()
        {
            this.transportListener.Listen(this.OnAcceptTransport);
        }

Usage Example

Example #1
0
        static void Run(string[] args)
        {
            List <string> endpoints = new List <string>();
            string        creds     = null;
            string        sslValue  = null;

            string[] queues        = null;
            bool     parseEndpoint = true;

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i][0] != '/' && parseEndpoint)
                {
                    endpoints.Add(args[i]);
                }
                else
                {
                    parseEndpoint = false;
                    if (args[i].StartsWith("/creds:", StringComparison.OrdinalIgnoreCase))
                    {
                        creds = args[i].Substring(7);
                    }
                    else if (args[i].StartsWith("/queues:", StringComparison.OrdinalIgnoreCase))
                    {
                        queues = args[i].Substring(8).Split(';');
                    }
                    else if (args[i].StartsWith("/cert:", StringComparison.OrdinalIgnoreCase))
                    {
                        sslValue = args[i].Substring(6);
                    }
                    else
                    {
                        Console.WriteLine("Unknown argument: {0}", args[i]);
                        Usage();
                        return;
                    }
                }
            }

            var broker = new TestAmqpBroker(endpoints, creds, sslValue, queues);

            broker.Start();

            Console.WriteLine("Broker started. Press the enter key to exit...");
            Console.ReadLine();

            broker.Stop();
            Console.WriteLine("Broker stopped");
        }
All Usage Examples Of TestAmqpBroker.TestAmqpBroker::Start