public void GetBars(string symbol, StBarInterval interval, System.DateTime since, int count) { Collector.InitDataRequest(symbol, interval, since, count); try { SmartComServer.GetBars(symbol, interval, since, count); } catch (Exception e) { DisconnectStockServer(); ConnectStockServer(); System.Threading.Thread.Sleep(7000); EmailSender.SendEmail("Server Disconnected", "In GetBars: Server was disconnected. Tryied to reconect.\r\n" + e.Message); SmartComServer.GetBars(symbol, interval, since, count); } //System.Threading.Thread.Sleep(500); }
public void GetBars(string symbol, StBarInterval interval, int count) { try { if (count <= 0) { throw new ListenerException(ExceptionImportanceLevel.MEDIUM, "GetBars", "Listener", "No other choice for count: " + count); } DateTime since = DateTime.Now; Collector.InitDataRequest(symbol, interval, since, count); InformUser(symbol + " - Geting Bars ..."); SmartComServer.GetBars(symbol, interval, since, count); } catch (SmartException e) { //dbWriter.InsertGeneral("Failed", "Listener"); dbWriter.InsertSts(Stocks.ServerTime.GetRealTime(), "Listener", "Failed"); Environment.Exit(0); } }