Esempio n. 1
0
        private void ReadDataFromDB()
        {
            //Logger.Info("Enter");

            DataTable dt = null;

            lock (m_CountLock)
            {
                string tempQueryString = "select * from Request INNER JOIN Response ON  Response.request_id = Request.dbid where  Response.lazy_status = 2;";
                try
                {
                    dt = AnalyzerManager.ProxydbObj.GetTableFromDB(tempQueryString, "PacketDetails");
                }
                catch (Exception ex)
                {
                    //Logger.Error(ex);
                }

                if (dt == null || dt.Rows.Count <= 0)
                {
                    return;
                }

                //int nCurrentLastRecordID = 0;

                //for (int i = 0; i < dt.Rows.Count; i++)
                //{
                //    int tempMaxValue = 0;
                //    int.TryParse(dt.Rows[i].ItemArray[17].ToString(), out tempMaxValue);
                //    if (tempMaxValue > nCurrentLastRecordID)
                //    {
                //        nCurrentLastRecordID = tempMaxValue;
                //    }

                //}
                //m_PrevLastRecordID = nCurrentLastRecordID;
            }

            foreach (var item in PacketCreator.CreatePackets(dt))
            {
                CurrentBuffer.Enqueue(item);
            }
            try
            {
                StartSendingPacketsToServer();
            }
            catch (Exception ex)
            {
                //Logger.Error(ex);
            }

            //Logger.Info("Exit");
        }