Пример #1
0
        static void Main(string[] args)
        {
            //if (args.Length == 0)
            //{
            //    throw new ArgumentNullException("Invalid argument");
            //}
            Console.WriteLine("Start Queue Reciever...");


            McChannelProperties prop1 = new McChannelProperties("NC_Quick");

            //McChannelProperties prop2 = new McChannelProperties("NC_Bulk");
            prop1.RecieveTimeout         = 60;
            prop1.MaxThread              = 5;
            prop1.AvailableThread        = 5;
            prop1.IsTrans                = false;
            prop1.UseMessageQueueListner = true;
            Channel cr1 = new Channel(prop1);

            cr1.start = DateTime.Now;
            cr1.StartAsyncQueue();


            //ChannelReciever cr2 = new ChannelReciever(prop2);
            //cr2.StartAsyncQueue();

/*
 *          QueueReciever qr = new QueueReciever("NC_Quick");//args[0]);//"NC_Quick");
 *          qr.BeginReceive();
 *          qr.Start();
 */

            Console.ReadLine();
        }
Пример #2
0
        private static void RunRemoteChannel()
        {
            McChannelProperties prop = new McChannelProperties("Cellcom");

            prop.MaxThread          = 20;
            prop.MinThread          = 2;
            prop.AutoThreadSettings = true;
            prop.QueueName          = "Cellcom";
            //prop.ConnectionString = cnn;
            prop.CoverMode = CoverMode.FileSystem;//.ItemsAndLog;
            prop.Server    = 0;
            //prop.Provider = QueueProvider.SqlServer;

            channel = new McChannel(prop, true);
            //channel.ReceiveCompleted += new QueueItemEventHandler(channel_ReceiveCompleted);

            RunThreads(new ThreadStart(AsyncChannelWorker), 1);
        }
Пример #3
0
        static void Main(string[] args)
        {
            //if (args.Length == 0)
            //{
            //    throw new ArgumentNullException("Invalid argument");
            //}
            Console.WriteLine("Start Queue Reciever...");

            string s = RemoteManager.Client.Reply("test");

            Console.Write(s);
            McChannelProperties prop1 = new McChannelProperties("NC_Quick");
            McChannelProperties prop2 = new McChannelProperties("NC_Bulk");

            prop1.RecieveTimeout = 60;
            prop2.RecieveTimeout = 60;

            ChannelReciever cr1 = new ChannelReciever(prop1);
            ChannelReciever cr2 = new ChannelReciever(prop2);

            cr1.StartAsyncQueue();
            cr2.StartAsyncQueue();

            //RemoteChannelManager.Instance.AddChannel(cr1);
            //RemoteChannelManager.Instance.AddChannel(cr2);
            //RemoteChannelManager.Instance.StartAsyncManager();

            //McThredSettings ts = new McThredSettings(1, 10, 5, true);
            //ts.RecieveTimeout = 30;
            //RemoteChannels rcs = new RemoteChannels(ts);
            //rcs.AddChannel(cr1);
            //rcs.AddChannel(cr2);
            //rcs.StartAsyncManager();

            //QueueReciever qr = new QueueReciever("NC_Quick");//args[0]);//"NC_Quick");
            //qr.Start();
            Console.ReadLine();
        }
Пример #4
0
 public ChannelReciever(McChannelProperties prop)
     : base(prop)
 {
 }
Пример #5
0
 public Channel(McChannelProperties prop)
     : base(prop)
 {
     Netlog.InfoFormat("Start Queue{0} ...", QueueName);
 }