☰
Login
Signup
Home
›
.Net API client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.8K
All Categories
0
Incidents
154
Node JS client
40
Go client
793
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
993
Java client
1.1K
API clients
404
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
OnError
infotrade
March 2019
in
.Net API client
Is it okay to call InitTicker again onError event?
code snippet:
private static void OnError(string Message)
{
File.AppendAllText(errorFile, "==========================================================" + Environment.NewLine);
File.AppendAllText(errorFile, DateTime.Now + Environment.NewLine);
File.AppendAllText(errorFile, "OnError: " + Message + Environment.NewLine);
Console.WriteLine("Error: " + Message);
ticker.Close();
initTicker();
File.AppendAllText(errorFile, "Call initTicker method for reconnecting socket" + Environment.NewLine);
}
private static void initTicker()
{
ticker = new Ticker(MyAPIKey, MyAccessToken);
ticker.OnTick += OnTick;
ticker.OnReconnect += OnReconnect;
ticker.OnNoReconnect += OnNoReconnect;
ticker.OnError += OnError;
ticker.OnClose += OnClose;
ticker.OnConnect += OnConnect;
ticker.OnOrderUpdate += OnOrderUpdate;
ticker.EnableReconnect(Interval: 5, Retries: 50);
ticker.Connect();
}
Sign In
or
Register
to comment.