I have been using Upstox JavaScript API for market data feed for last 4 months. I have seen one recurring issue.
Use Case: When there is a sudden disruption in my standard internet, I switch to my mobile hotspot. Apparently previous connection still continues and I get error to create new websocket connection. In that case, I create new token and use it to create new websocket connection.
How to handle such cases from my end?
How do you detect from your end whether websocket connection is really being listened by the client or is dead? Because in the above case, previous websocket connection should generally end by itself.