Ejemplo n.º 1
0
        /**/
        /// <summary>
        /// 对此HTTP请求处理的过程全部结束
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Dispose(object sender, EventArgs e)
        {
            HttpApplication application = this.Context.ApplicationInstance;

            //装配过滤器
            application.Response.Filter = new RawFilter(application.Response.Filter);
            //绑定过滤器事件
            RawFilter filter = (RawFilter)application.Response.Filter;

            filter.OnRawDataRecordedEvent += new EventHandler <RawDataEventArgs>(filter_OnRawDataRecordedEvent);
        }

        /**/
        /// <summary>
        /// 当原始数据采集到以后,写日志
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void filter_OnRawDataRecordedEvent(object sender, RawDataEventArgs e)
        {
            string allcode = e.SourceCode;

            try
            {
                Dictionary <string, string> dicRet = new Dictionary <string, string>();
                XmlDocument document = new XmlDocument();
                try
                {
                    document.LoadXml(allcode);
                    string retValue = document.DocumentElement.InnerXml;

                    if (!string.IsNullOrEmpty(retValue))
                    {
                        dicRet.Add("Return", retValue);
                    }
                    else
                    {
                        dicRet.Add("Return", "");
                    }
                    //this._log.WriteXmlLog(dicRet);
                }
                catch (XmlException)
                {
                    dicRet.Add("Return", "");
                    // this._log.WriteXmlLog(dicRet);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        private static void Client_RawPacketReceived(object sender, RawDataEventArgs e)
        {
            if (e.RawPacket.Contains("count"))
            {
                return;
            }

            Terminal.WriteLine($" -> {e.RawPacket}");
        }
        void Session_RawDataReceived(object sender, RawDataEventArgs e)
        {
            totalBytesReceived += e.Data.LongLength;
            StringBuilder data = new StringBuilder($"SessionPhase: {e.Phase} - RawDataReceived: ");

            foreach (var item in e.Data)
            {
                data.AppendFormat("{0:X2} ", item);
            }
            System.Diagnostics.Debug.WriteLine(data.ToString());
        }
Ejemplo n.º 4
0
        internal void OnRawData(Tuple <Point3D, Quaternion> armData,
                                Tuple <Point3D, Quaternion> wristData, Tuple <Point3D, Quaternion> fingerData,
                                Point location, double distanceToArmCenter, double hoverDistance,
                                SkinEventType skinEventType, RawDataEventType rawEventType)
        {
            RawDataEventArgs e = new RawDataEventArgs(
                armData.Item1, armData.Item2, wristData.Item1, wristData.Item2,
                fingerData.Item1, fingerData.Item2, location, distanceToArmCenter,
                hoverDistance, skinEventType, rawEventType);

            RawData?.Invoke(this, e);
        }
Ejemplo n.º 5
0
        void _client_OnRawDataReceived(object sender, RawDataEventArgs e)
        {
            var data = e.GetData();

            AddLog("RX:" + data.Length + " bytes:" + BitConverter.ToString(data));

            RXCount += data.Length;
            UpdateDataCounters();

            if (chkDataLog.Checked)
            {
                OpenDataLogger();
                _swDataLoggerTXT.WriteLine(string.Format("RX({0}/{1}):{2}", data.Length, RXCount, BitConverter.ToString(data)));
                _swDataLoggerBIN.BaseStream.Write(data, 0, data.Length);
            }
        }
Ejemplo n.º 6
0
        void _client_OnRawDataSend(object sender, RawDataEventArgs e)
        {
            //throw new NotImplementedException();
            var data = e.GetData();

            AddLog("TX:" + BitConverter.ToString(data));
            TXCount += data.Length;
            UpdateDataCounters();

            if (chkDataLog.Checked)
            {
                OpenDataLogger();
                _swDataLoggerTXT.WriteLine(string.Format("TX({0}/{1}):{2}", data.Length, TXCount, BitConverter.ToString(data)));
                // Do not store data in BIN version
            }
        }
Ejemplo n.º 7
0
 private void Client_RawDataSent(object sender, RawDataEventArgs e)
 {
     this.Log(e.Data, MessageType.Sent);
 }
Ejemplo n.º 8
0
 private void Client_RawDataReceived(object sender, RawDataEventArgs e)
 {
     this.Log(e.Data, MessageType.Received);
 }
Ejemplo n.º 9
0
 private static void Client_RawPacketSent(object sender, RawDataEventArgs e)
 {
     Terminal.WriteLine($" <- {e.RawPacket}");
 }
Ejemplo n.º 10
0
 private void FSD_RawDataReceived(object sender, RawDataEventArgs e)
 {
     mRawDataStream.Write("[{0}]     <<< {1}", DateTime.UtcNow.ToString("HH:mm:ss.fff"), e.Data);
     mRawDataStream.Flush();
 }
Ejemplo n.º 11
0
 private void FSD_RawDataSent(object sender, RawDataEventArgs e)
 {
     mRawDataStream.Write("[{0}] >>>     {1}", DateTime.UtcNow.ToString("HH:mm:ss.fff"), e.Data.Replace(mConfig.VatsimPassword, "XXXXXX"));
     mRawDataStream.Flush();
 }
Ejemplo n.º 12
0
 private void Client_RawPacketReceived(object sender, RawDataEventArgs e)
 => Console.WriteLine($" -> {e.RawPacket}");
Ejemplo n.º 13
0
 private void Client_RawPacketSent(object sender, RawDataEventArgs e)
 => Console.WriteLine($" <- {e.RawPacket}");