示例#1
0
        void MadMapperClient_PacketReceived(object sender, OSCPacket e)
        {
            var msg = e as OSCMessage;

            if (msg != null)
            {
                var address = new OSCAddress(e.Address);

                // get identifier
                var id = address.Id;

                // return if message is not relevant
                if (!results.ContainsKey(id))
                {
                    return;
                }

                // check if this is the replayMessageCount address
                if (address.Root.Equals("replyMessageCount"))
                {
                    // set result count
                    results [id].ResultCount = (int)msg.Values [0];
                }
                else
                {
                    // add msg to result
                    msg.Address = address.BaseAddress;
                    results [id].Packets.Add(msg);
                }

                // fire lock to let waiters check
                newMessageArrived.Set();
            }
        }
示例#2
0
		void MadMapperClient_PacketReceived (object sender, OSCPacket e)
		{
			var msg = e as OSCMessage;

			if (msg != null) {

				var address = new OSCAddress (e.Address);

				// get identifier
				var id = address.Id;

				// return if message is not relevant
				if (!results.ContainsKey (id))
					return;

				// check if this is the replayMessageCount address
				if (address.Root.Equals ("replyMessageCount")) {
					// set result count
					results [id].ResultCount = (int)msg.Values [0];
				} else {
					// add msg to result
					msg.Address = address.BaseAddress;
					results [id].Packets.Add (msg);
				}

				// fire lock to let waiters check
				newMessageArrived.Set ();
			}
		}