On Fri Sep 28 22:13:30 2012, tripp@wasteoftime.org wrote:
Show quoted text> I'm a hack programmer at best, so if I'm way off, please let me know.
>
> It seems like when you call processMessages() it blocks for a very long
> time if no messages are coming in. I possibly want to do something during
> this time. So I changed the timeout specificly for the select in the
> processMessages function to wait only a second.
>
> I don't quiet understand what you're doing with the ping deadline and
such,
Show quoted text> so maybe I'm just missunderstanding the situation.
Hi, thanks for using F::IB::SWIG!
You're reading it right, there is a pretty long delay. It's intended to
be a (mostly) blocking "wait for messages" call, but it has a timeout
explicitly to send the pings required by the IB protocol. In fact, if
you look at the tws_api code, you'll see that that method is mostly just
a pared-down version of their own call.
In my own implementation I only use the IB client as a daemon, and don't
react to the events directly (except through a distributed message
queue), and do my "other" concurrent activities separately. Other
mechanisms include multithreading, etc.
If you need the shorter timeout for your application, it sounds like
you've got it sorted.
I'll leave this open, as I may add an optional constructor argument or
other mechanism in the future to introduce a programmable delay or
non-blocking processMessages call once I have a chance to think through
the best way of doing it.