public void error(int id, int errorCode, string errorMsg) { if (id == -1 && Array.IndexOf(TwsRtdServerErrors.TwsServerErrors(), errorCode) >= 0) { m_connection.SetError(TwsRtdServerErrors.CANNOT_CONNECT_TO_TWS, errorMsg); } if (id != -1 && Array.IndexOf(TwsRtdServerErrors.TwsTickerErrors(), errorCode) >= 0) { TwsRtdServerMktDataRequest mktDataRequest = m_connection.GetMktDataRequest(id); if (mktDataRequest != null) { mktDataRequest.SetError(errorCode, errorMsg); } switch (errorCode) { case 10167: { SetAllLiveTopicsValues(id, "TwsRtdServer error: " + errorMsg); break; } default: { SetAllTopicsValues(id, "TwsRtdServer error: " + errorMsg); break; } } } }
public void rerouteMktDataReq(int reqId, int conId, string exchange) { TwsRtdServerMktDataRequest mktDataRequest = m_connection.GetMktDataRequest(reqId); String errorMsg = "Re-route market data request to conId:" + conId + " exchange:" + exchange; if (mktDataRequest != null) { mktDataRequest.SetError(TwsRtdServerErrors.REQUEST_MKT_DATA_ERROR, errorMsg); } SetAllTopicsValues(reqId, "TwsRtdServer error: " + errorMsg); }