示例#1
0
        public void RaiseEventFake(OSCPacket packet)
        {
            OSCPacketReceivedEventArgs args = new OSCPacketReceivedEventArgs();

            args.packet = packet;
            OnOSCPacketReceivedEvent(args);
        }
示例#2
0
        /// <summary>
        /// Event raised when a packet is received
        /// </summary>
        private void OnOSCPacketReceivedEvent(OSCPacketReceivedEventArgs e)
        {
            OSCPacketReceivedEventHandler handler = OSCPacketReceivedEvent;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#3
0
        /// <summary>
        /// Event consumer for udp message received. Raises OSCPacketReceivedEvent.
        /// </summary>
        public void udpClient_MessageReceived(object sender, DatagramSocketMessageReceivedEventArgs e)
        {
            DataReader reader = e.GetDataReader();

            if (reader.UnconsumedBufferLength > 0)
            {
                byte[] bytes = new byte[reader.UnconsumedBufferLength];
                reader.ReadBytes(bytes);
                OSCPacketReceivedEventArgs args = new OSCPacketReceivedEventArgs();
                args.packet = OSCPacket.Unpack(bytes);
                OnOSCPacketReceivedEvent(args);
                Debug.WriteLine(args.packet.ToString());
            }
        }