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)); //} } }
void _mSocket_OnNotifyMulticastSocketListener(object sender, NotifyMulticastSocketListenerEventArgs e) { if(e.Type == MulticastSocketMessageType.MessageReceived) Console.WriteLine(_count++); }