修改实例
老邱 authored at 2016-12-22 11:30:21
932.00 B
X
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NewLife.Log;
using NewLife.Net;
using NewLife.Queue.Broker;
using NewLife.Queue.Center;
using NewLife.Queue.Clients;
using NewLife.Remoting;

namespace CenterService
{
    class Program
    {
        private static BrokerService svr;
        static void Main(string[] args)
        {
            XTrace.UseConsole();
            XTrace.Debug = true;
            svr = new BrokerService { ProducerServer = { Log = XTrace.Log } };
            Test();
            System.Threading.Thread.Sleep(1000);
            Client();
            Console.ReadLine();
        }

        static void Test()
        {
           svr.Start();
        }

        static async void Client()
        {
            var client = new ProducerClient {Log = XTrace.Log};
            await client.RegisterProducer();
        }
    }
}