Ejemplo n.º 1
0
 private void OnBundleReceived(OscBundle bundle, string origin)
 {
     foreach (OscPacket packet in bundle.Contents)
     {
         if (packet is OscBundle)
         {
             OscBundle subBundle = packet as OscBundle;
             OnBundleReceived(subBundle, origin);
         }
         else
         {
             OscMessage message = packet as OscMessage;
             OnMessageReceived(message, origin);
         }
     }
 }
Ejemplo n.º 2
0
        public OscReceiver()
        {
            AddressOnMessageReceived = new Dictionary <string, EventHandler <OSCMessageReceivedArgs> >();
            receiver = new UdpSocketReceiver();

            receiver.MessageReceived += (sender, args) =>
            {
                OscPacket packet = OscPacket.Parse(args.ByteData);
                if (packet is OscBundle)
                {
                    OscBundle bundle = packet as OscBundle;
                    OnBundleReceived(bundle, args.RemoteAddress);
                }
                else
                {
                    OscMessage message = packet as OscMessage;
                    OnMessageReceived(message, args.RemoteAddress);
                }
            };
        }