Exemplo n.º 1
0
        protected void RaiseDataReceived(IPEndPoint point, byte[] data)
        {
            var e = new DataReceivedEventArgs() { EndPoint = point, Data = data };

            ThreadPool.QueueUserWorkItem(delegate
            {
                DataReceived(this, e);
            });
        }
Exemplo n.º 2
0
        private void OnDataReceived(object sender,DataReceivedEventArgs e)
        {
            Stream data = new MemoryStream(e.Data);
            IPEndPoint endpoint = e.EndPoint;

            var header = (FTKEYBOARD.Protocol.ProtocolType)data.ReadByte();
            switch (header)
            {
                case FTKEYBOARD.Protocol.ProtocolType.OP_FTKEYBOARDHEADER:
                    ProcessPacketFTK(ref data, ref endpoint);
                    break;
                default:
                    //todo:
                    break;
            }
        }