Пример #1
0
        static void Main(string[] mainArgs)
        {
            Options opts = new Options();
            opts.Parse(mainArgs);
            QueueChannelFactory.SetBroker(opts.broker, opts.port);
            QueueChannelFactory.SetSecurity(opts.ssl, opts.username, opts.password);

            WarmUpTransactionSubsystem(opts);

            if (opts.type == ClientType.Publisher)
            {
                PublishThread pub = new PublishThread(opts.baseName + "0", "", opts);
                Thread pubThread = new Thread(pub.Run);
                pubThread.Start();
                pubThread.Join();
            }
            else if (opts.type == ClientType.Subscriber)
            {
                SubscribeThread sub = new SubscribeThread(opts.baseName + "0", opts);
                Thread subThread = new Thread(sub.Run);
                subThread.Start();
                subThread.Join();
            }
            else
            {
                InteropDemo(opts);
            }

            if (System.Diagnostics.Debugger.IsAttached)
            {
                Console.WriteLine("Hit return to continue...");
                Console.ReadLine();
            }
        }