コード例 #1
0
ファイル: Program.cs プロジェクト: dingzuoxiang/NetMQ
        private static async Task CreatePushSocket()
        {
            var poller = new NetMQPoller();

            push = new PushSocket();
            push.BindRandomPort("tcp://127.0.0.1");
            NetMQMonitor monitor = new NetMQMonitor(push, "inproc://req.inproc", SocketEvents.All);

            monitor.Connected     += Monitor_Connected;
            monitor.EventReceived += Monitor_EventReceived;
            //monitor.AttachToPoller(poller);
            queue.ReceiveReady += Queue_ReceiveReady;;
            push.Connect(address);
            poller.Add(push);
            poller.Add(queue);
            poller.RunAsync();
            await monitor.StartAsync();
        }