You need to maintain a local datastructure of your subscriptions. e.g after the below lines: ticker.subscribe([53429767]); ticker.setMode(ticker.modeFull, [53429767]);
you can add the subscription to your local datastructure allSubscriptions.Add(53429767);
In this case, allSubscriptions will be a list of Unsigned Long integers.
When you require to know what symbols are subscribed, you need to just loop through allSubscriptions list
If you are using KiteConnect official C# library, its already there: private void _onConnect() { // Reset timer and retry counts and resubscribe to tokens. _retryCount = 0; _timerTick = _interval; _timer.Start(); if (_subscribedTokens.Count > 0) ReSubscribe(); OnConnect?.Invoke(); }
In the above case, _subscribedTokens is a dictionary private Dictionary _subscribedTokens;
You can get your subscribed tokens here and in case of disconnection and reconnection, the old subscriptions are picked up from this dictionary and re-subscribed.
e.g after the below lines:
ticker.subscribe([53429767]);
ticker.setMode(ticker.modeFull, [53429767]);
you can add the subscription to your local datastructure
allSubscriptions.Add(53429767);
In this case, allSubscriptions will be a list of Unsigned Long integers.
When you require to know what symbols are subscribed, you need to just loop through allSubscriptions list
also is there any callbacks if my subscription is successful ?
private void _onConnect()
{
// Reset timer and retry counts and resubscribe to tokens.
_retryCount = 0;
_timerTick = _interval;
_timer.Start();
if (_subscribedTokens.Count > 0)
ReSubscribe();
OnConnect?.Invoke();
}
In the above case, _subscribedTokens is a dictionary
private Dictionary _subscribedTokens;
You can get your subscribed tokens here and in case of disconnection and reconnection, the old subscriptions are picked up from this dictionary and re-subscribed.