Re: [Quickfix-developers] Integrate socket connections into application-wide async socket loop
Brought to you by:
orenmnero
|
From: Sean L. <sea...@da...> - 2006-06-16 02:33:12
|
Oren, On 16 Jun 2006, at 1:36 AM, or...@qu... wrote: > Well, since the SocketInitiator *is* a SocketConnector::Strategy, I > don't see any reason why you can't just inherit from > SocketInitiator and override onConnect, onData and onDisconnect > (they should probably move from private to protected). the Swig > wrappers should allow you to do this no problem. Yes - that's much simpler. I actually have to make the SocketInitiator methods public to make Swig hook into them - Swig ignores pretty much everything that isn't public, which given the uncontrolled nature of scripting language object access kind of makes sense. I'm not sure whether you want to make the methods public? It does greatly increase the functionality of the Python wrappers - particularly if the same principle got applied throughout the codebase... > Just remeber to call the base method in your overrides. Make sure > your event loop has a timeout so you can call poll occasionally in > order to process timeouts and such. Timing out every second will > work well for any heartbeat interval. Yes, I've got that in place anyway as the proprietary protocol I'm interoperating with has a similar heartbeat. Thanks for the swift response and the help. Sean -- Sean Legassick se...@da... |