Hello Folks,
Is there a mechanism to receive an instant callback when the connection between the TWS application and the IBKR server is lost, specifically due to an internet disruption?
Currently, TWS provides this information via the following callback:
void error(
? ? int id, int errorCode, const std::string& errorString,
? ? const std::string& advancedOrderRejectJson)
With the response:
Code: 1100 – "Connectivity between IBKR and Trader Workstation has been lost."
However, this callback takes approximately 45 to 60 seconds to trigger. I'm looking for a way to detect the disconnection immediately.
Additionally, is there a method to cancel all pending requests that the TWS application attempts to send to the IBKR server once the connection is restored? Currently, reconnection is indicated by:
Code: 1102 – "Connectivity between IBKR and Trader Workstation has been restored."
?
Thanks.