问题
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