You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess this is more of a general question in the direction of the API itself, but suppose that the TWS /Gateway connection is lost (internet outage, TWS crash, whatever), and by some automatic means the TWS is restarted and reinstated. How does one go about regaining the market subscription after reconnect? The obvious approach of
clientSocket.eConnect(....)
and then calling after successful connection (clientSocket.isConnected() is true)
clientSocket.reqRealTimeBars(...)
with a new id does not work. Connection is successful, but it seems any api calls are inactive/dead. I also tried instantiating a new reader = new EReader(clientSocket..) but that does nothing either.
Would you happen to have any insights on this?
Thanks for you help!
The text was updated successfully, but these errors were encountered:
Hi @clisztian!
In cases like this, I would restart the whole application instead of handling the issue programmatically. The outage itself is an infrastructure issue, so I would handle it like that and create some kind of monitoring tool which restarts the service when the connection is reestablished.
I guess this is more of a general question in the direction of the API itself, but suppose that the TWS /Gateway connection is lost (internet outage, TWS crash, whatever), and by some automatic means the TWS is restarted and reinstated. How does one go about regaining the market subscription after reconnect? The obvious approach of
clientSocket.eConnect(....)
and then calling after successful connection (clientSocket.isConnected() is true)
clientSocket.reqRealTimeBars(...)
with a new id does not work. Connection is successful, but it seems any api calls are inactive/dead. I also tried instantiating a new reader = new EReader(clientSocket..) but that does nothing either.
Would you happen to have any insights on this?
Thanks for you help!
The text was updated successfully, but these errors were encountered: