Distinguishing between two QuickFix initiator sessions

社会主义新天地 提交于 2019-12-12 22:08:42

问题


I am using QuickFix with Python bindings to connect to a broker and I have two Initiator Sessions in my config file. One is for the price and the other for the order session.

My question is, say I want to do something when only one of them comes online? If I do

initiator = fix.SocketInitiator(application, storeFactory, settings, logFactory)
if initiator.isLoggedOn():
    function()

then function will be called whether it is the price or order session or both that are logged on. How do I identify when a specific initiator session is logged on?


回答1:


As you noted, the method bool Initiator::isLoggedOn() will tell you if any session is currently logged on.

Use bool Initiator::isConnected( const SessionID& sessionID ) to check a specific session.

SocketInitiator inherits both of these from Initiator.



来源:https://stackoverflow.com/questions/29523954/distinguishing-between-two-quickfix-initiator-sessions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!