I'm using official kiteconnect nodejs package to get live market feeds, I'm facing two problems
1) It's reconnecting atleast 100 - 200 times from 09:15 AM to 03:20 PM. Which leads to resubscribe to list of instruments 100 - 200 times. Is there a way to keep the connection alive?
2) After 03:20 PM I don't want to keep this connection alive, Which is keep creating above issue even after market close, So is there a method to disconnect/close the connection?
1. Getting disconnected could be reliability issue with your network and if you enabled auto connect then it will try to resubscribe after getting connected. 2. You can disable `autoReconnect` before disconnecting after 3.30. In next release we will add utility method to do this.
Can you paste the complete stack trace?
Try running in debug mode to get the complete stack trace.
You need to call unsubscribe and then disconnect method.
1) I'll post the stack trace of kt.on("reconnect",{}) soon.
2) I did unsubscribe and then disconnect but still it's getting auto reconnect and calling subscribe again & again.
Result:
>> subscribe
>> ticks
>> disconnect
>> subscribe
>> ticks
2. You can disable `autoReconnect` before disconnecting after 3.30. In next release we will add utility method to do this.