private void StartSendingPacketsToServer() { //Logger.Info("Enter"); byte[] output = JSONCircularBuffer.ExportToHAR(CurrentBuffer); if (TestTCPClient.TestConfig.TestCheck) { if (TestTCPClient.SendLazyPacketsToServer("1", output)) { foreach (SessionHandler oSessionHandler in CurrentBuffer) { AnalyzerManager.ProxydbObj.UpdateDB("update response set lazy_status = 3 where request_id = '" + oSessionHandler.RequestID + "'"); } } } else { if (TCPClients.SendLazyPacketsToServer("1", output)) { foreach (SessionHandler oSessionHandler in CurrentBuffer) { AnalyzerManager.ProxydbObj.UpdateDB("update response set lazy_status = 3 where request_id = '" + oSessionHandler.RequestID + "'"); } } } //Logger.Info("Exit"); }
private static void StartStoredAndForward(object obj) { //Logger.Info("Enter"); try { string tempQueryString = "select * from alert_failed"; DataTable dt = AnalyzerManager.ProxydbObj.GetTableFromDB(tempQueryString, "AlertDetails"); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { if (TestTCPClient.TestConfig.TestCheck) { if (TestTCPClient.SendAlertMessageToServer("2", (byte[])row[1], false)) { string command = "delete from alert_failed where dbid = " + Convert.ToInt32(row[0]); ProxyDbs.ProxyDb.DeleteRowFromTable(command); } } else { if (TCPClients.SendAlertMessageToServer("2", (byte[])row[1], false)) { string command = "delete from alert_failed where dbid = " + Convert.ToInt32(row[0]); ProxyDbs.ProxyDb.DeleteRowFromTable(command); } } } } } catch (Exception ex) { //Logger.Error(ex); } try { string tempQueryString = "select * from lazy_failed"; DataTable dt = AnalyzerManager.ProxydbObj.GetTableFromDB(tempQueryString, "LazyDetails"); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { if (TestTCPClient.TestConfig.TestCheck) { if (TestTCPClient.SendLazyPacketsToServer("1", (byte[])row[1], false)) { string command = "delete from lazy_failed where dbid = " + Convert.ToInt32(row[0]); ProxyDbs.ProxyDb.DeleteRowFromTable(command); } } else { if (TCPClients.SendLazyPacketsToServer("1", (byte[])row[1], false)) { string command = "delete from lazy_failed where dbid = " + Convert.ToInt32(row[0]); ProxyDbs.ProxyDb.DeleteRowFromTable(command); } } } } } catch (Exception ex) { //Logger.Error(ex); } //Logger.Info("Exit"); }