Re: [Quickfix-developers] Integrate socket connections into application-wide async socket loop
Brought to you by:
orenmnero
|
From: <or...@qu...> - 2006-06-15 23:36:25
|
<DIV name="wmMessageComp">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. 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.</DIV> <DIV name="wmMessageComp"> </DIV> <DIV name="wmMessageComp">--oren</DIV> <BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid" name="wmMessageComp">I guess in C++ I would subclass the strategy as that owns the FDs, <BR>and then use a replacement SocketInitiator that subclasses my <BR>customized strategy and Initiator. Would that be the right way to go? <BR>Could I actually do this all successfully in pure Python? If I can, <BR>then I'll still have to rewrite SocketInitiator in Python right?<BR></BLOCKQUOTE> |