/// <summary> /// Call this method to terminate the connections with TWS. Calling this method does not cancel orders that have already been sent. /// </summary> public void Disconnect() { lock (this) { GeneralTracer.WriteLineIf(ibTrace.TraceInfo, "IBClient Disconnect"); ClientSocket.eDisconnect(); } }
/// <summary> /// The bulk of the clean-up code is implemented in Dispose(bool) /// </summary> /// <param name="disposing">Allows the ondispose method to override the dispose action.</param> protected virtual void Dispose(bool disposing) { if (disposing) { GeneralTracer.WriteLineIf(ibTrace.TraceInfo, "IBClient Dispose"); ClientSocket.eDisconnect(); ClientSocket.Close(); } }