There is no TWS API function to monitor the amount of unprocessed data in the socket that your client uses to connect with TWS API and I am not sure that would be a good approach in the first place. You just need to structure your client such that it is event driven and always ready to process TWS API callback function calls. Your callbacks:
Callbacks alert you about the arrival of new data and trigger processing (possibly at a later time). Simple and fast tasks can be performed right away, but anything more serious needs to be handled by a thread other than the callback thread. Every programming language has built-in or library add-ons that provide the tools you need for an event-driven client structure. In this setup, your client can manage the data flow actively and by importance of the message:
We have never seen any backup issues and process in excess of 20,000 messages per second in peak situations. ´³¨¹°ù²µ±ð²Ô |