Not sure that there is anything wrong with the connect/disconnect API design. Works well for many of us (and for some of us for decades). Also, not sure what objects of the previous reader thread need to be transported. The reader thread (I guess that is the one you are taking about) has only one purpose and contains no long-term state:
When your client is not connected yet (504) or an existing connection with TWS/IBGW is lost (502), no network socket exists and there is no need for a reader thread. When a new network connection exists upon a successful connect() , a new reader thread is created to process the messages as long as that socket exists. At any point in time, your client may voluntarily call disconnect()/connect() or, upon receiving an error 502, call connect() to reestablish the connection. In the architecture of your application stack, TWS API is way at the bottom as an "Adapter" with a very simple interface contract:
´³¨¹°ù²µ±ð²Ô On Sat, Jul 29, 2023 at 02:31 PM, John wrote: bump this thread |