示例#1
0
 public static void Main(string[] args)
 {
     using (var context = ZmqContext.Create())
     {
         using (var queue = new ZeroMQ.Devices.QueueDevice(context, "tcp://*:5559", "tcp://*:5560"))
         {
         }
     }
 }
示例#2
0
文件: msgqueue.cs 项目: Boshin/zguide
 public static void Main(string[] args)
 {
     using (var context = ZmqContext.Create())
     {
         using (var queue = new ZeroMQ.Devices.QueueDevice(context, "tcp://*:5559", "tcp://*:5560"))
         {
             
         }
     }
 }
示例#3
0
文件: mtserver.cs 项目: varstr/zguide
        public static void Main(string[] args)
        {
            using (var context = ZmqContext.Create())
            {

                using (var queue = new ZeroMQ.Devices.QueueDevice(context, "tcp://*:5555", "inproc://workers"))
                {
                    var workerThreads = new Thread[5];
                    for (int threadId = 0; threadId < workerThreads.Length; threadId++)
                    {
                        workerThreads[threadId] = new Thread(WorkerRoutine);
                        workerThreads[threadId].Start(context);
                    }
                }

            }
        }
示例#4
0
        private void SendReceiveWithDevice()
        {
            using (var broker = new ZeroMQ.Devices.QueueDevice(this.zmqContext, this.frontendAddress, this.backendAddress, ZeroMQ.Devices.DeviceMode.Blocking))
            {
                try
                {
                    broker.Start();

                    //while (Interlocked.Read(ref this.running) == 1)
                    //{

                    //}
                }
                finally
                {
                    broker.Stop();
                }
            }
        }
示例#5
0
        private void SendReceiveWithDevice()
        {
            using (var broker = new ZeroMQ.Devices.QueueDevice(this.zmqContext, this.frontendAddress, this.backendAddress, ZeroMQ.Devices.DeviceMode.Blocking))
            {
                try
                {
                    broker.Start();

                    //while (Interlocked.Read(ref this.running) == 1)
                    //{

                    //}
                }
                finally
                {
                    broker.Stop();
                }
            }
        }