Example #1
0
        /// <summary>
        ///     Create a new NetMQBeacon.
        /// </summary>
        public NetMQBeacon()
        {
            this.m_actor = NetMQActor.Create(new Shim());

            EventHandler <NetMQActorEventArgs> onReceive = (sender, e) => this.m_receiveEvent.Fire(this, new NetMQBeaconEventArgs(this));

            this.m_receiveEvent = new EventDelegator <NetMQBeaconEventArgs>(
                () => this.m_actor.ReceiveReady += onReceive,
                () => this.m_actor.ReceiveReady -= onReceive);
        }
Example #2
0
 /// <summary>
 ///     Create NetMQProactor and start dedicate thread to handle incoming messages.
 /// </summary>
 /// <param name="receiveSocket">Socket to handle messages from</param>
 /// <param name="handler">Handler to handle incoming messages</param>
 public NetMQProactor(NetMQSocket receiveSocket, Action <NetMQSocket, NetMQMessage> handler)
 {
     this.m_receiveSocket = receiveSocket;
     this.m_handler       = handler;
     this.m_actor         = NetMQActor.Create(this.Run);
 }