コード例 #1
0
ファイル: PointerNode.cs プロジェクト: madebysoren/NooSphere
        private void _mSocket_OnNotifyMulticastSocketListener(object sender, NotifyMulticastSocketListenerEventArgs e)
        {
            if (e.Type == MulticastSocketMessageType.MessageReceived)
            {
                var msg = System.Text.Encoding.ASCII.GetString((byte[])e.NewObject);

                var res = new PointerMessage(Convert.ToInt32(msg.Split('@')[0]), Convert.ToInt32(msg.Split('@')[1]), (PointerEvent)Enum.Parse(typeof(PointerEvent), msg.Split('@')[2]));
                
 

                HandleMessage(res);
                //if(DataReceived != null)
                //{
                //    DataReceived(this,new DataEventArgs(msg));
                //}
            }
        }
コード例 #2
0
 void _mSocket_OnNotifyMulticastSocketListener(object sender, NotifyMulticastSocketListenerEventArgs e)
 {
     if(e.Type == MulticastSocketMessageType.MessageReceived)
         Console.WriteLine(_count++);
 }